Skip to content

Commit

Permalink
chore: add test build version to draft
Browse files Browse the repository at this point in the history
  • Loading branch information
fcying committed Aug 31, 2024
1 parent 5f668be commit 8ab197b
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
contents: write
env:
VERSION: ""
COMMIT: ""
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -31,10 +33,14 @@ jobs:
version=""
new_ver=$(grep -Po "v\d+\.\d+\.\d+" cmd/compiledb/main.go)
cur_ver=$(git describe --abbrev=0 --tags)
commit=$(git rev-parse --short HEAD)
if [ "$new_ver" != "$cur_ver" ]; then
version=$new_ver
else
sed -E "s|v[0-9]+\.[0-9]+\.[0-9]+|test version($commit)|" cmd/compiledb/main.go -i
fi
echo "VERSION=$version" >> $GITHUB_ENV
echo "COMMIT=$commit" >> $GITHUB_ENV
- name: Install dependencies
run: go mod tidy
Expand Down Expand Up @@ -65,11 +71,12 @@ jobs:
tar cJvf compiledb.txz compiledb
mv compiledb.txz $out/compiledb-darwin-arm64.txz
gh release delete test --cleanup-tag -y || true
ls -la $out
- uses: actions/upload-artifact@v4
with:
name: bin
name: binary
path: build/*

- name: Release
Expand All @@ -81,3 +88,14 @@ jobs:
artifactErrorsFailBuild: true
generateReleaseNotes: true
artifacts: "build/*"

- name: Update latest
uses: ncipollo/release-action@v1
with:
tag: test
artifactErrorsFailBuild: true
generateReleaseNotes: true
name: test version ${{ env.COMMIT }}
prerelease: true
draft: true
artifacts: "build/*"

0 comments on commit 8ab197b

Please sign in to comment.