-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 1.85 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release
on:
push:
branches:
- master
env:
HUSKY: 0 # https://typicode.github.io/husky/how-to.html#ci-server-and-docker
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Needed for nx-set-shas within nx-cloud-main.yml, when run on the master branch
permissions:
actions: read
contents: write
deployments: write
pull-requests: write
id-token: write
jobs:
Process:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release-please.outputs.releases_created }}
prs_created: ${{ steps.release-please.outputs.prs_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release-please
with:
token: ${{secrets.RELEASE_PLEASE_TOKEN}}
- name: Print Release Data
run: |
echo 'Release Data:'
echo '''
${{ toJSON(steps.release-please.outputs) }}
'''
Deploy:
needs: Process
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Asdf
uses: ./.github/actions/setup-tooling
with:
SetupCommand: ./setup.sh
- name: Yarn
uses: ./.github/actions/setup-yarn
- name: Configure Publishing
uses: ./.github/actions/setup-npm-publish
with:
NpmRegistryUrl: https://registry.npmjs.org/
NpmRcFile: .npmrc
- name: Preflight
run: |
just lint
just types
just test
just build
- if: ${{ needs.Process.outputs.releases_created == 'true' }}
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: just stage=production publish
- if: ${{ needs.Process.outputs.prs_created == 'true' }}
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: just stage=development publish