From 799751a1c3a6a9a24a3ba8c23f9ea002e398d8cc Mon Sep 17 00:00:00 2001 From: veyvin Date: Sun, 26 Jul 2026 13:57:21 +0000 Subject: [PATCH] feat: GoReleaser Git Tag Error Co-authored-by: traeagent --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 77c5977..cc95a66 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,6 +38,8 @@ jobs: name: Build ${{ matrix.display_name }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup pnpm uses: pnpm/action-setup@v3 @@ -67,6 +69,18 @@ jobs: VERSION=$(node -p "require('./package.json').version") echo "version=v$VERSION" >> $GITHUB_OUTPUT + - name: Ensure git tag exists locally + shell: bash + run: | + VERSION="${{ matrix.platform == 'windows-latest' && steps.get_version_windows.outputs.version || steps.get_version_unix.outputs.version }}" + git fetch --tags --depth=1 origin "refs/tags/${VERSION}:refs/tags/${VERSION}" 2>/dev/null || true + if ! git rev-parse "$VERSION" >/dev/null 2>&1; then + git tag "$VERSION" + echo "Created local tag $VERSION" + else + echo "Tag $VERSION already exists" + fi + - name: install Rust stable uses: dtolnay/rust-toolchain@stable with: @@ -129,6 +143,8 @@ jobs: name: Build ${{ matrix.display_name }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Setup pnpm uses: pnpm/action-setup@v3 @@ -149,6 +165,19 @@ jobs: $VERSION = (node -p "require('./package.json').version") echo "version=v$VERSION" >> $env:GITHUB_OUTPUT + - name: Ensure git tag exists locally + shell: pwsh + run: | + $version = "${{ steps.get_version.outputs.version }}" + git fetch --tags --depth=1 origin "refs/tags/${version}:refs/tags/${version}" 2>$null + $null = git rev-parse "$version" 2>$null + if ($LASTEXITCODE -ne 0) { + git tag "$version" + Write-Host "Created local tag $version" + } else { + Write-Host "Tag $version already exists" + } + - name: install Rust stable uses: dtolnay/rust-toolchain@stable with: