@@ -2,11 +2,8 @@ name: Release build
22
33on :
44 push :
5- branches :
6- - main
7- - develop
8- - next
9- workflow_dispatch :
5+ tags :
6+ - ' v2*next*'
107
118jobs :
129 prepare :
@@ -36,68 +33,48 @@ jobs:
3633
3734 release :
3835 name : release
36+ needs : prepare
3937 runs-on : ubuntu-latest
40- needs :
41- prepare
38+ outputs :
39+ upload_url : ${{ steps.create_release.outputs.upload_url }}
4240 steps :
43- - uses : actions/checkout@v3
44- with :
45- fetch-depth : 0
46- persist-credentials : false
47- - uses : actions/download-artifact@v3
48- with :
49- name : webhook
50- path : artifacts
51- - uses : actions/download-artifact@v3
52- with :
53- name : runners
54- path : artifacts
55- - uses : actions/download-artifact@v3
56- with :
57- name : runner-binaries-syncer
58- path : artifacts
59-
60- - name : Get installation token
61- 62- id : app-token
63- with :
64- appId : ${{ secrets.FOREST_RELEASER_APP_ID }}
65- appPrivateKeyBase64 : ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
66- appInstallationType : repo
67- appInstallationValue : ${{ github.repository }}
68-
69- - name : Dry run release
70- if : github.event_name != 'pull_request'
41+ - name : Checkout code
42+ uses : actions/checkout@v3
43+ - name : Create Release
44+ id : create_release
45+ uses : actions/create-release@v1
7146 env :
72- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Read only token
73- run : |
74- cp .release/* .
75- yarn
76- yarn release -d --repositoryUrl https://x-access-token:[email protected] /$GITHUB_REPOSITORY.git 47+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48+ with :
49+ tag_name : ${{ github.ref }}
50+ release_name : Release ${{ github.ref }}
51+ body : |
52+ Next release
53+ draft : true
54+ prerelease : false
7755
78- - name : Release
79- if : (github.event_name != 'pull_request' && contains('refs/heads/main', github.ref))
80- env :
81- GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
82- run : |
83- cp .release/* .
84- yarn
85- yarn release --repositoryUrl https://x-access-token:[email protected] /$GITHUB_REPOSITORY.git 56+ assets :
57+ name : upload assets
58+ needs : release
59+ runs-on : ubuntu-latest
8660
87- provenance :
88- name : Generate provenance
89- runs-on : ubuntu-20.04
90- needs :
91- release
92- if : startsWith(github.ref, 'refs/tags/')
61+ strategy :
62+ matrix :
63+ asset : ["webhook", "runner-binaries-syncer", "runners"]
9364
9465 steps :
95- - name : Generate provenance for release
96- uses :
philips-labs/[email protected] 66+ - uses : actions/download-artifact@v3
9767 with :
98- artifact_path : release-assets
99- output_path : ' build.provenance'
100- tag_name : " ${{ github.ref_name }}"
101- env :
102- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
68+ name : ${{ matrix.asset }}
69+ path : artifacts
10370
71+ - name : Upload Release Asset
72+ id : upload-release-asset
73+ uses : actions/upload-release-asset@v1
74+ env :
75+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
76+ with :
77+ upload_url : ${{ needs.release.outputs.upload_url }}
78+ asset_path : artifacts/${{ matrix.asset }}.zip
79+ asset_name : ${{ matrix.asset }}.zip
80+ asset_content_type : application/zip
0 commit comments