4
4
push :
5
5
branches :
6
6
- main
7
- - develop
8
- workflow_dispatch :
7
+ - refactor/release
9
8
10
9
jobs :
11
10
prepare :
15
14
strategy :
16
15
matrix :
17
16
lambda : ["modules/webhook/lambdas/webhook", "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer", "modules/runners/lambdas/runners"]
17
+ permissions :
18
+ contents : read
19
+ actions : write
18
20
steps :
19
21
- name : Extract lambda name
20
22
id : lambda
@@ -38,65 +40,59 @@ jobs:
38
40
runs-on : ubuntu-latest
39
41
needs :
40
42
prepare
43
+ outputs :
44
+ upload_url : ${{ steps.release.outputs.upload_url }}
45
+ releases_created : ${{ steps.release.outputs.releases_created }}
46
+ permissions :
47
+ contents : write
48
+ issues : write
49
+ pull-requests : write
50
+ actions : write
41
51
steps :
42
- - uses : actions/checkout@v3
43
- with :
44
- fetch-depth : 0
45
- persist-credentials : false
46
- - uses : actions/download-artifact@v3
47
- with :
48
- name : webhook
49
- path : artifacts
50
- - uses : actions/download-artifact@v3
51
- with :
52
- name : runners
53
- path : artifacts
54
- - uses : actions/download-artifact@v3
55
- with :
56
- name : runner-binaries-syncer
57
- path : artifacts
58
-
59
52
- name : Get installation token
60
53
61
- id : app- token
54
+ id : token
62
55
with :
63
56
appId : ${{ secrets.FOREST_RELEASER_APP_ID }}
64
57
appPrivateKeyBase64 : ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY_BASE64 }}
65
58
appInstallationType : repo
66
59
appInstallationValue : ${{ github.repository }}
67
60
68
- - name : Dry run release
69
- if : github.event_name != 'pull_request'
70
- env :
71
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Read only token
72
- run : |
73
- cp .release/* .
74
- yarn
75
- yarn release -d --repositoryUrl https://x-access-token:[email protected] /$GITHUB_REPOSITORY.git
76
-
61
+ # bootstrap-sha and release-as needs to be removed after first release
77
62
- name : Release
78
- if : github.event_name != 'pull_request' && contains('refs/heads/main', github.ref)
79
- env :
80
- GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
81
- run : |
82
- cp .release/* .
83
- yarn
84
- yarn release --repositoryUrl https://x-access-token:[email protected] /$GITHUB_REPOSITORY.git
85
-
86
- provenance :
87
- name : Generate provenance
88
- runs-on : ubuntu-20.04
89
- needs :
90
- release
91
- if : startsWith(github.ref, 'refs/tags/')
63
+ id : release
64
+ uses : google-github-actions/release-please-action@5c07f8be172b1f6e90f9c35baf8184461b91b85f # ratchet:google-github-actions/release-please-action@v3
65
+ with :
66
+ default-branch : main
67
+ release-type : terraform-module
68
+ token : ${{ steps.token.outputs.token }}
69
+ last-release-sha : b404332ff8b401a5a8958317a69b9f849b794a16
70
+
71
+ assets :
72
+ name : upload assets
73
+ if : ${{ needs.release.outputs.releases_created }}
74
+ needs : release
75
+ runs-on : ubuntu-latest
76
+ strategy :
77
+ matrix :
78
+ asset : ["webhook", "runner-binaries-syncer", "runners"]
79
+ permissions :
80
+ contents : write
81
+ actions : read
92
82
93
83
steps :
94
- - name : Generate provenance for release
95
- uses :
philips-labs/[email protected]
84
+ - uses : actions/download-artifact@v3
96
85
with :
97
- artifact_path : release-assets
98
- output_path : ' build.provenance'
99
- tag_name : " ${{ github.ref_name }}"
100
- env :
101
- GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
86
+ name : ${{ matrix.asset }}
87
+ path : artifacts
102
88
89
+ - name : Upload Release Asset
90
+ id : upload-release-asset
91
+ uses : actions/upload-release-asset@v1
92
+ env :
93
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
94
+ with :
95
+ upload_url : ${{ needs.release.outputs.upload_url }}
96
+ asset_path : artifacts/${{ matrix.asset }}.zip
97
+ asset_name : ${{ matrix.asset }}.zip
98
+ asset_content_type : application/zip
0 commit comments