Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit fe257c4

Browse files
authored
feat: set correct latest release (#10)
1 parent 4fcb9ad commit fe257c4

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
release:
3232
runs-on: ubuntu-latest
3333
needs: [check]
34-
if: github.event_name == 'push'
3534
permissions:
3635
contents: write
3736
strategy:
@@ -59,6 +58,23 @@ jobs:
5958
- name: Build packages
6059
uses: docker/bake-action@v2
6160
- name: Create GitHub release
61+
if: github.event_name == 'push'
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464
run: scripts/create_release.sh
65+
66+
set-latest:
67+
runs-on: ubuntu-latest
68+
needs: release
69+
if: github.event_name == 'push'
70+
permissions:
71+
contents: write
72+
steps:
73+
- name: Checkout
74+
uses: actions/checkout@v3
75+
with:
76+
fetch-depth: 0
77+
- name: Set latest release
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
run: scripts/set_latest_release.sh

scripts/set_latest_release.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Fail on error
4+
set -o errexit
5+
# Fail on pipeline
6+
set -o pipefail
7+
# Disable undefined variable reference
8+
set -o nounset
9+
10+
latest_tag=$(git tag -l --sort=-version:refname | head -1)
11+
readonly latest_tag
12+
13+
gh release edit "${latest_tag}" --latest

0 commit comments

Comments
 (0)