4
4
push :
5
5
branches :
6
6
- main
7
- pull_request :
8
- types : [opened, synchronize, reopened, closed]
9
- branches :
10
- - main
11
7
12
8
concurrency :
13
9
group : release
@@ -18,53 +14,13 @@ jobs:
18
14
outputs :
19
15
releases_created : ${{ steps.release.outputs.releases_created }}
20
16
tag_name : ${{ steps.release.outputs.tag_name }}
21
- pr : ${{ steps.release.outputs.pr }}
22
17
steps :
23
18
- id : release
24
19
name : Run release-please
25
20
uses : googleapis/release-please-action@v4
26
21
with :
27
22
config-file : " .github/prerelease-config.json"
28
23
manifest-file : " .github/prerelease-manifest.json"
29
- fork : false
30
- token : ${{ secrets.GITHUB_TOKEN }}
31
-
32
- update-manifest-in-pr :
33
- runs-on : ubuntu-latest
34
- needs : release-please
35
- # Only run when a release PR is opened or updated, not when it's merged
36
- if : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref == 'release-please--branches--main' && github.event.pull_request.closed == false }}
37
- steps :
38
- - name : Checkout PR branch
39
- uses : actions/checkout@v4
40
- with :
41
- ref : ${{ github.event.pull_request.head.ref }}
42
- token : ${{ secrets.GITHUB_TOKEN }}
43
-
44
- - name : Extract new version
45
- id : extract-version
46
- run : |
47
- PR_TITLE="${{ github.event.pull_request.title }}"
48
- if [[ $PR_TITLE =~ chore\(main\):[[:space:]]release[[:space:]]([0-9]+\.[0-9]+\.[0-9]+) ]]; then
49
- echo "version=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT
50
- else
51
- echo "version=" >> $GITHUB_OUTPUT
52
- fi
53
-
54
- - name : Update prerelease manifest with new version
55
- if : ${{ steps.extract-version.outputs.version != '' }}
56
- env :
57
- MANIFEST_PATH : .github/prerelease-manifest.json
58
- VERSION : ${{ steps.extract-version.outputs.version }}
59
- run : |
60
- jq --arg tag "$VERSION" '.["."] = $tag' $MANIFEST_PATH > temp.json \
61
- && mv temp.json $MANIFEST_PATH
62
-
63
- git config user.name "github-actions[bot]"
64
- git config user.email "github-actions[bot]@users.noreply.github.com"
65
- git add $MANIFEST_PATH
66
- git commit -m "chore: update prerelease manifest with version $VERSION"
67
- git push
68
24
69
25
deploy-test :
70
26
name : Deploy to Test
@@ -116,35 +72,6 @@ jobs:
116
72
117
73
- name : Deploy
118
74
run : echo "Deploying to production!"
119
-
120
- sync-after-release :
121
- name : Sync Release Manifest
122
- runs-on : ubuntu-latest
123
- # Only run when a release is created and PR is merged (push to main)
124
- if : ${{ github.event_name == 'push' && needs.release-please.outputs.releases_created == 'true' }}
125
- needs : release-please
126
- steps :
127
- - name : Checkout main branch
128
- uses : actions/checkout@v4
129
- with :
130
- token : ${{ secrets.RELEASE_TOKEN }} # Use a token with repo scope
131
-
132
- - name : Update prerelease manifest
133
- env :
134
- MANIFEST_PATH : .github/prerelease-manifest.json
135
- RELEASE_TAG : ${{ needs.release-please.outputs.tag_name }}
136
- run : |
137
- # Remove the 'v' prefix if present
138
- VERSION="${RELEASE_TAG//v/}"
139
-
140
- jq --arg tag "$VERSION" '.["."] = $tag' $MANIFEST_PATH > temp.json \
141
- && mv temp.json $MANIFEST_PATH
142
-
143
- git config user.name "github-actions[bot]"
144
- git config user.email "github-actions[bot]@users.noreply.github.com"
145
- git add $MANIFEST_PATH
146
- git commit -m "chore: sync prerelease manifest with version $VERSION"
147
- git push
148
75
149
76
publish :
150
77
name : Publish images
164
91
run : echo "Building for '${{ matrix.arch }}' ..."
165
92
166
93
- name : Publish
167
- run : echo "Publishing for '${{ matrix.arch }}' ..."
94
+ run : echo "Publishing for '${{ matrix.arch }}' ..."
0 commit comments