@@ -2,11 +2,8 @@ name: Release build
2
2
3
3
on :
4
4
push :
5
- branches :
6
- - main
7
- - develop
8
- - next
9
- workflow_dispatch :
5
+ tags :
6
+ - ' v2*next*'
10
7
11
8
jobs :
12
9
prepare :
@@ -36,68 +33,46 @@ jobs:
36
33
37
34
release :
38
35
name : release
36
+ needs : prepare
39
37
runs-on : ubuntu-latest
40
- needs :
41
- prepare
42
38
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'
39
+ - name : Checkout code
40
+ uses : actions/checkout@v3
41
+ - name : Create Release
42
+ id : create_release
43
+ uses : actions/create-release@v1
71
44
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
45
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
+ with :
47
+ tag_name : ${{ github.ref }}
48
+ release_name : Release ${{ github.ref }}
49
+ body : |
50
+ Next release
51
+ draft : true
52
+ prerelease : false
77
53
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
54
+ assets :
55
+ name : upload assets
56
+ needs : release
57
+ runs-on : ubuntu-latest
86
58
87
- provenance :
88
- name : Generate provenance
89
- runs-on : ubuntu-20.04
90
- needs :
91
- release
92
- if : startsWith(github.ref, 'refs/tags/')
59
+ strategy :
60
+ matrix :
61
+ asset : ["webhook", "runner-binaries-syncer", "runners"]
93
62
94
63
steps :
95
- - name : Generate provenance for release
96
- uses :
philips-labs/[email protected]
64
+ - uses : actions/download-artifact@v3
97
65
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 }}"
66
+ name : ${{ matrix.asset }}
67
+ path : artifacts
103
68
69
+ - name : Upload Release Asset
70
+ id : upload-release-asset
71
+ uses : actions/upload-release-asset@v1
72
+ env :
73
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
74
+ with :
75
+ upload_url : ${{ needs.release.outputs.upload_url }}
76
+ asset_path : artifacts/${{ matrix.asset }}.zip
77
+ asset_name : ${{ matrix.asset }}.zip
78
+ asset_content_type : application/zip
0 commit comments