Skip to content

Commit 96b117d

Browse files
Add release process to CI:
Signed-off-by: Jacob Weinstock <[email protected]>
1 parent aa19a4a commit 96b117d

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

.github/workflows/build-all-matrix.yaml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ jobs:
171171
name: "hook-tarball-${{ matrix.kernel }}"
172172
path: out/*.tar.gz
173173

174-
release:
174+
release-latest:
175175
name: Publish all Hooks to GitHub Releases
176176
needs: [ matrix_prep, build-hook-ensemble ]
177177
runs-on: ubuntu-latest
@@ -238,3 +238,52 @@ jobs:
238238
checksum.txt
239239
prerelease: true
240240
tag_name: latest
241+
242+
release-tag:
243+
name: Publish all Hooks to GitHub Releases for a tag
244+
needs: [ matrix_prep, build-hook-ensemble ]
245+
runs-on: ubuntu-latest
246+
if: startsWith(github.ref, 'refs/tags/v')
247+
steps:
248+
249+
- name: Checkout code
250+
uses: actions/checkout@v4
251+
252+
- name: Download built Hook artifacts
253+
uses: actions/download-artifact@v4
254+
with:
255+
pattern: "hook-tarball-*"
256+
merge-multiple: true
257+
258+
- name: Figure Out Commit Short ID
259+
id: commitid
260+
run: |
261+
echo ::set-output name=short::$(git rev-parse --short HEAD)
262+
263+
- name: Generate Release Notes
264+
run: |
265+
generated_release_notes=$(gh api 'repos/{owner}/{repo}/releases/generate-notes' -F tag_name=${{github.ref}} --jq .body)
266+
cat >>"$GITHUB_ENV" <<-EOF
267+
RELEASE_NOTES<<RELEASE_NOTES_EOF
268+
$generated_release_notes
269+
RELEASE_NOTES_EOF
270+
EOF
271+
env:
272+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
273+
274+
- name: Generate checksum
275+
uses: jmgilman/actions-generate-checksum@v1
276+
with:
277+
method: sha512
278+
patterns: "*.tar.gz"
279+
280+
- name: Update tag release
281+
uses: softprops/action-gh-release@v2
282+
with:
283+
name: ${{github.ref}}
284+
body: ${{env.RELEASE_NOTES}}
285+
files: |
286+
*.tar.gz
287+
checksum.txt
288+
prerelease: true
289+
tag_name: ${{github.ref}}

0 commit comments

Comments
 (0)