1
- name : Pre-release main branch
1
+ name : Release
2
2
3
3
on :
4
- release :
5
- types : [published]
6
-
4
+ workflow_dispatch :
5
+
7
6
permissions :
8
7
contents : read
9
8
packages : write
10
9
11
10
jobs :
11
+
12
+ release-drafter :
13
+ concurrency :
14
+ group : release-drafter
15
+ outputs :
16
+ tag_name : ${{ steps.release-drafter.outputs.tag_name }}
17
+ permissions :
18
+ contents : write
19
+ pull-requests : read
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : Verify branch
23
+ run : |
24
+ if [[ "${{ github.ref }}" != refs/heads/main ]]; then
25
+ echo "This workflow is only allowed to run on the main branch."
26
+ exit 1
27
+ fi
28
+ - uses : release-drafter/release-drafter@b1476f6e6eb133afa41ed8589daba6dc69b4d3f5 # v6.1.0
29
+ id : release-drafter
30
+ env :
31
+ GITHUB_TOKEN : ${{ github.token }}
32
+ - name : Create tag
33
+ uses : actions/github-script@v7
34
+ with :
35
+ script : |
36
+ github.rest.git.createRef({
37
+ owner: context.repo.owner,
38
+ repo: context.repo.repo,
39
+ ref: 'refs/tags/${{ steps.release-drafter.outputs.tag_name }}',
40
+ sha: context.sha
41
+ })
42
+
12
43
containers :
13
44
runs-on : ubuntu-latest
14
45
outputs :
17
48
18
49
steps :
19
50
- uses : actions/checkout@v4
20
-
51
+ with :
52
+ ref : ${{ steps.release-drafter.outputs.tag_name }}
21
53
- name : Bootstrap Action Workspace
22
54
id : bootstrap
23
55
uses : ./.github/actions/bootstrap
@@ -29,16 +61,19 @@ jobs:
29
61
username : ${{ github.actor }}
30
62
password : ${{ secrets.GITHUB_TOKEN }}
31
63
32
-
33
64
- name : Publish Containers
34
65
run : ./build.sh publishcontainers
35
66
36
67
release-lambda :
37
68
runs-on : ubuntu-latest
69
+ needs :
70
+ - release-drafter
38
71
permissions :
39
72
contents : write
40
73
steps :
41
74
- uses : actions/checkout@v4
75
+ with :
76
+ ref : ${{ steps.release-drafter.outputs.tag_name }}
42
77
- name : Amazon Linux 2023 build
43
78
run : |
44
79
docker build . -t publish-links-index:latest -f src/infra/docs-lambda-index-publisher/lambda.DockerFile
@@ -50,11 +85,13 @@ jobs:
50
85
- name : Attach Distribution to release
51
86
env :
52
87
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53
- run : gh release upload ${{ github.event. release.tag_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
88
+ run : gh release upload ${{ needs. release-drafter.outputs .tag_name }} .artifacts/docs-lambda-index-publisher/release_linux-x64/bootstrap
54
89
shell : bash
55
90
56
91
release :
57
- needs : [containers]
92
+ needs :
93
+ - containers
94
+ - release-drafter
58
95
strategy :
59
96
fail-fast : false
60
97
matrix :
70
107
71
108
steps :
72
109
- uses : actions/checkout@v4
110
+ with :
111
+ ref : ${{ steps.release-drafter.outputs.tag_name }}
73
112
74
113
- name : Bootstrap Action Workspace
75
114
id : bootstrap
@@ -90,6 +129,20 @@ jobs:
90
129
env :
91
130
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92
131
run : |
93
- gh release upload ${{ github.event. release.tag_name }} .artifacts/publish/docs-builder/release/*.zip
94
- gh release upload ${{ github.event. release.tag_name }} .artifacts/publish/docs-assembler/release/*.zip
132
+ gh release upload ${{ needs. release-drafter.outputs .tag_name }} .artifacts/publish/docs-builder/release/*.zip
133
+ gh release upload ${{ needs. release-drafter.outputs .tag_name }} .artifacts/publish/docs-assembler/release/*.zip
95
134
shell : bash
135
+
136
+ publish-release :
137
+ needs :
138
+ - release
139
+ - release-lambda
140
+ - release-drafter
141
+ runs-on : ubuntu-latest
142
+ steps :
143
+ - name : Publish release
144
+ env :
145
+ GH_TOKEN : ${{ github.token }}
146
+ TAG_NAME : ${{ needs.release-drafter.outputs.tag_name }}
147
+ run : |
148
+ gh release edit ${{ needs.release-drafter.outputs.tag_name }} --draft=false --latest
0 commit comments