forked from nx-dotnet/nx-dotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (58 loc) · 1.74 KB
/
release.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
62
63
name: Release
on: workflow_dispatch
env:
NX_BRANCH: ${{ github.event.number }}
NX_RUN_GROUP: ${{ github.run_id }}
jobs:
build:
runs-on: ubuntu-latest
name: Building affected apps
steps:
- uses: actions/checkout@v1
- uses: bahmutov/[email protected]
- run: yarn nx affected --target=build --base=origin/master~1 --parallel
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist
e2e:
runs-on: ubuntu-latest
name: E2E testing affected apps
needs: [build]
steps:
- uses: actions/checkout@v1
- uses: bahmutov/[email protected]
- name: Download a single artifact
continue-on-error: true
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- run: yarn e2e
- run: git reset --hard
semantic-release:
runs-on: ubuntu-latest
name: Publish packages via semantic release
needs: [e2e]
if: ${{github.event_name == 'workflow_dispatch'}}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
registry-url: 'https://registry.npmjs.org'
always-auth: true,
node-version: 14
- uses: bahmutov/[email protected]
- name: Git Config
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Setup NPM Auth
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm whoami
- name: Release
run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}