diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8e4916..270342a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,7 @@ jobs: contents: write env: VERSION: "" + GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 with: @@ -33,6 +34,9 @@ jobs: cur_ver=$(git describe --abbrev=0 --tags) if [ "$new_ver" != "$cur_ver" ]; then version=$new_ver + else + id=$(git rev-parse --short HEAD) + sed -E "s|v[0-9]+\.[0-9]+\.[0-9]+|$id|" cmd/compiledb/main.go -i fi echo "VERSION=$version" >> $GITHUB_ENV @@ -65,11 +69,12 @@ jobs: tar cJvf compiledb.txz compiledb mv compiledb.txz $out/compiledb-darwin-arm64.txz + gh release delete latest --cleanup-tag -y || true ls -la $out - uses: actions/upload-artifact@v4 with: - name: bin + name: binary path: build/* - name: Release @@ -81,3 +86,13 @@ jobs: artifactErrorsFailBuild: true generateReleaseNotes: true artifacts: "build/*" + + - name: Update latest + uses: ncipollo/release-action@v1 + with: + tag: latest + artifactErrorsFailBuild: true + generateReleaseNotes: true + prerelease: true + draft: true + artifacts: "build/*"