-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (57 loc) · 1.74 KB
/
trunk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: trunk
on:
push:
branches: [main]
jobs:
test:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node-version: [14.x, 16.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn
- name: Install Dependencies
run: yarn --frozen-lockfile
- run: yarn build
- run: yarn test
# https://github.community/t/how-can-i-test-if-secrets-are-available-in-an-action/17911/10?u=jasonkuhrt
checkNpmTokenSet:
name: Check if NPM_TOKEN secret is set
runs-on: ubuntu-latest
outputs:
is_NPM_TOKEN_set: ${{ steps.checkNpmTokenSet.outputs.is_MY_SECRET_set }}
steps:
- name: Check if NPM_TOKEN secret is set
id: checkNpmTokenSet
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo "is_NPM_TOKEN_set: ${{ env.NPM_TOKEN != '' }}"
echo "::set-output name=is_NPM_TOKEN_set::${{ env.NPM_TOKEN != '' }}"
release-canary:
needs: [test, checkNpmTokenSet]
if: needs.checkNpmTokenSet.outputs.is_NPM_TOKEN_set == 'true'
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: yarn
- name: Install Dependencies
run: yarn --frozen-lockfile
- name: Release Canary
run: |
yarn dripip preview --json > result.json
jq '.' < result.json