Skip to content

Commit 06ff5d8

Browse files
Update release-tag.yaml to our own workflow
1 parent dc6694b commit 06ff5d8

1 file changed

Lines changed: 28 additions & 6 deletions

File tree

.github/workflows/release-tag.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,36 @@ name: Tag Release
22

33
on:
44
release:
5+
types: [published]
6+
7+
concurrency:
8+
group: release-tag
9+
cancel-in-progress: false
10+
11+
permissions:
12+
contents: write
513

614
jobs:
715
update-tag:
816
runs-on: ubuntu-latest
9-
17+
if: ${{ !github.event.release.prerelease && !github.event.release.draft }}
18+
1019
steps:
11-
- name: Run latest-tag
12-
uses: EndBug/latest-tag@latest
13-
with:
14-
ref: prod
15-
description: Latest release to prod
20+
- name: Checkout the release commit
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.release.tag_name }}
24+
fetch-depth: 1
25+
26+
- name: Configure git identity
27+
run: |
28+
git config user.name "latest github tag bot"
29+
git config user.email "webmaster@csh.rit.edu"
30+
31+
- name: Move "latest" to the release commit
32+
run: |
33+
set -euo pipefail
34+
target_sha="$(git rev-parse "HEAD^{commit}")" # parses tag to git sha hash
35+
echo "Release ${{ github.event.release.tag_name }} -> ${target_sha}"
36+
git tag --force latest "${target_sha}"
37+
git push --force origin refs/tags/latest

0 commit comments

Comments
 (0)