Skip to content

Commit

Permalink
ci: improve git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Itsusinn committed Sep 19, 2024
1 parent f6d595d commit 5cab280
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ jobs:

release:
name: Release
if: github.event_name != 'pull_request'
needs: [ compile ]
runs-on: ubuntu-latest
steps:
Expand All @@ -267,19 +266,22 @@ jobs:
name: binaries
path: ./packages

- name: Delete previous latest tag
- name: Clean git tag & release
if: startsWith(github.ref, 'refs/heads/master')
run: |
# Deleted latest tag and push it
git tag -d latest || true
git push origin :refs/tags/latest || true
# Deleted all drafts
gh release list | grep Draft | awk '{print $1 " \t"}' | while read -r line; do gh release delete -y "$line"; done
env:
GH_TOKEN: ${{ github.token }}

- name: Create new latest tag
if: startsWith(github.ref, 'refs/heads/master')
- name: Clean git tag
if: startsWith(github.ref, 'refs/tags/v*')
run: |
git tag latest
git push origin latest
# Delete latest tag (for git-cliff)
git tag -d latest || true
- name: SHA256sums
run: |
Expand Down Expand Up @@ -314,6 +316,7 @@ jobs:
# YYYYMMDD_hhmmss (UTC)
TIME=$(date --utc +%Y%m%d_%H%M%SZ)
echo ${TIME}-${GIT_SHA} >> packages/version.txt
cat packages/version.txt
env:
GIT_SHA: ${{ github.sha }}

Expand Down

0 comments on commit 5cab280

Please sign in to comment.