@@ -2,81 +2,33 @@ name: Release
22on :
33 workflow_dispatch :
44 inputs :
5- docs_only :
6- description : Skip package release and publish documentation only
7- default : false
8- type : boolean
9- skip_docs :
10- description : Skip publishing the documentation
11- default : false
12- type : boolean
135 dry_run :
146 description : Run package release in "dry run" mode (does not publish either)
157 default : false
168 type : boolean
17- docs_env :
18- description : Pick environment to publish documentation to
19- required : true
20- type : choice
21- default : staging
22- options :
23- - production
24- - staging
259
2610jobs :
2711 package_release :
2812 name : Release from "${{ github.ref_name }}" branch
2913 runs-on : ubuntu-latest
3014 # GH does not allow to limit branches in the workflow_dispatch settings so this here is a safety measure
31- if : ${{ !inputs.docs_only && (startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master')) }}
32- env :
33- NODE_OPTIONS : --max_old_space_size=4096
15+ if : ${{ inputs.dry_run || startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master') }}
3416 steps :
3517 - name : Checkout
36- uses : actions/checkout@v3
18+ uses : actions/checkout@v4
3719 with :
3820 fetch-depth : 0
39- - name : Setup Node.js
40- uses : actions/setup-node@v3
41- with :
42- node-version : 20
43- - name : Install dependencies & Build
44- run : |
45- yarn install --frozen-lockfile
46- yarn run build
21+
22+ - uses : ./.github/actions/setup-node
23+
4724 - name : Validate CommonJS bundle
4825 run : yarn validate-cjs
26+
4927 - name : Release
5028 env :
5129 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
52- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5330 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5431 HUSKY : 0
5532 run : >
5633 yarn semantic-release
5734 ${{ inputs.dry_run && '--dry-run' || '' }}
58-
59- docs_release :
60- name : Publish documentation from "${{ github.ref_name }}" branch to ${{ inputs.docs_env }}
61- runs-on : ubuntu-latest
62- # skip during dry runs, publish to production only from master or branches with names starting with "release", publish to staging from anywhere
63- if : ${{ !inputs.dry_run && !inputs.skip_docs && (((github.ref_name == 'master' || startsWith(github.ref_name, 'release')) && inputs.docs_env == 'production') || inputs.docs_env == 'staging') }}
64- outputs :
65- target-version : $${{ steps.target-version.outputs }}
66- steps :
67- - name : Checkout
68- uses : actions/checkout@v3
69- - name : Setup Node.js
70- uses : actions/setup-node@v3
71- with :
72- node-version : 20
73- - name : Install dependencies
74- run : yarn install --frozen-lockfile --ignore-engines --ignore-scripts
75- - name : Merge shared "@stream-io/stream-chat-css" docs
76- run : yarn docs:copy-css-docs
77- - name : Push to stream-chat-docusaurus
78- uses : GetStream/push-stream-chat-docusaurus-action@main
79- with :
80- target-branch : ${{ inputs.docs_env }}
81- env :
82- DOCUSAURUS_GH_TOKEN : ${{ secrets.DOCUSAURUS_GH_TOKEN }}
0 commit comments