From 8fc2d11c5f7ca13a88fcb7b72ba024905381b564 Mon Sep 17 00:00:00 2001 From: Developer Date: Tue, 7 Apr 2026 12:27:05 -0700 Subject: [PATCH] Fix builds failing to checkout: stop deleting tags, fix tag passing Two issues causing all builds to fail: 1. Cleanup steps deleted git tags along with releases. Since builds are dispatched asynchronously, they tried to checkout tags that had already been deleted. Now cleanup only deletes releases (which frees storage by removing assets) but preserves git tags. 2. Linux/macOS build workflows used $GITHUB_OUTPUT step outputs for the tag, which is unreliable on Gitea runners. Switched to the same job-level env var pattern (RELEASE_TAG) that works on Windows. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/build-app-linux.yml | 19 +++++-------------- .gitea/workflows/build-app-macos.yml | 19 +++++-------------- .gitea/workflows/build-sidecar-linux.yml | 19 +++++-------------- .gitea/workflows/build-sidecar-macos.yml | 19 +++++-------------- .gitea/workflows/release.yml | 6 ++---- .gitea/workflows/sidecar-release.yml | 6 ++---- 6 files changed, 24 insertions(+), 64 deletions(-) diff --git a/.gitea/workflows/build-app-linux.yml b/.gitea/workflows/build-app-linux.yml index b0d8964..4d6f86a 100644 --- a/.gitea/workflows/build-app-linux.yml +++ b/.gitea/workflows/build-app-linux.yml @@ -13,23 +13,14 @@ jobs: runs-on: ubuntu-latest env: NODE_VERSION: "20" + RELEASE_TAG: ${{ inputs.tag }} steps: - - name: Determine tag - id: tag - run: | - TAG="${{ inputs.tag }}" - if [ -z "$TAG" ]; then - TAG="${{ github.event.inputs.tag }}" - fi - if [ -z "$TAG" ]; then - TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||') - fi - echo "Building for tag: ${TAG}" - echo "tag=${TAG}" >> $GITHUB_OUTPUT + - name: Show tag + run: echo "Building for tag: ${RELEASE_TAG}" - uses: actions/checkout@v4 with: - ref: ${{ steps.tag.outputs.tag }} + ref: ${{ inputs.tag }} - name: Set up Node.js uses: actions/setup-node@v4 @@ -58,7 +49,7 @@ jobs: run: | sudo apt-get install -y jq REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" - TAG="${{ steps.tag.outputs.tag }}" + TAG="${RELEASE_TAG}" echo "Release tag: ${TAG}" echo "Waiting for release ${TAG} to be available..." diff --git a/.gitea/workflows/build-app-macos.yml b/.gitea/workflows/build-app-macos.yml index 38ba639..068ad56 100644 --- a/.gitea/workflows/build-app-macos.yml +++ b/.gitea/workflows/build-app-macos.yml @@ -13,23 +13,14 @@ jobs: runs-on: macos-latest env: NODE_VERSION: "20" + RELEASE_TAG: ${{ inputs.tag }} steps: - - name: Determine tag - id: tag - run: | - TAG="${{ inputs.tag }}" - if [ -z "$TAG" ]; then - TAG="${{ github.event.inputs.tag }}" - fi - if [ -z "$TAG" ]; then - TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/v*' | head -1 | sed 's|.*refs/tags/||') - fi - echo "Building for tag: ${TAG}" - echo "tag=${TAG}" >> $GITHUB_OUTPUT + - name: Show tag + run: echo "Building for tag: ${RELEASE_TAG}" - uses: actions/checkout@v4 with: - ref: ${{ steps.tag.outputs.tag }} + ref: ${{ inputs.tag }} - name: Set up Node.js uses: actions/setup-node@v4 @@ -56,7 +47,7 @@ jobs: run: | which jq || brew install jq REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" - TAG="${{ steps.tag.outputs.tag }}" + TAG="${RELEASE_TAG}" echo "Release tag: ${TAG}" echo "Waiting for release ${TAG} to be available..." diff --git a/.gitea/workflows/build-sidecar-linux.yml b/.gitea/workflows/build-sidecar-linux.yml index c9a604a..77ff38a 100644 --- a/.gitea/workflows/build-sidecar-linux.yml +++ b/.gitea/workflows/build-sidecar-linux.yml @@ -13,23 +13,14 @@ jobs: runs-on: ubuntu-latest env: PYTHON_VERSION: "3.11" + RELEASE_TAG: ${{ inputs.tag }} steps: - - name: Determine tag - id: tag - run: | - TAG="${{ inputs.tag }}" - if [ -z "$TAG" ]; then - TAG="${{ github.event.inputs.tag }}" - fi - if [ -z "$TAG" ]; then - TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||') - fi - echo "Building for tag: ${TAG}" - echo "tag=${TAG}" >> $GITHUB_OUTPUT + - name: Show tag + run: echo "Building for tag: ${RELEASE_TAG}" - uses: actions/checkout@v4 with: - ref: ${{ steps.tag.outputs.tag }} + ref: ${{ inputs.tag }} - name: Install uv run: | @@ -75,7 +66,7 @@ jobs: run: | sudo apt-get install -y jq REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" - TAG="${{ steps.tag.outputs.tag }}" + TAG="${RELEASE_TAG}" echo "Waiting for sidecar release ${TAG} to be available..." for i in $(seq 1 30); do diff --git a/.gitea/workflows/build-sidecar-macos.yml b/.gitea/workflows/build-sidecar-macos.yml index 84e060b..e8eec8d 100644 --- a/.gitea/workflows/build-sidecar-macos.yml +++ b/.gitea/workflows/build-sidecar-macos.yml @@ -13,23 +13,14 @@ jobs: runs-on: macos-latest env: PYTHON_VERSION: "3.11" + RELEASE_TAG: ${{ inputs.tag }} steps: - - name: Determine tag - id: tag - run: | - TAG="${{ inputs.tag }}" - if [ -z "$TAG" ]; then - TAG="${{ github.event.inputs.tag }}" - fi - if [ -z "$TAG" ]; then - TAG=$(git ls-remote --tags --sort=-v:refname origin 'refs/tags/sidecar-v*' | head -1 | sed 's|.*refs/tags/||') - fi - echo "Building for tag: ${TAG}" - echo "tag=${TAG}" >> $GITHUB_OUTPUT + - name: Show tag + run: echo "Building for tag: ${RELEASE_TAG}" - uses: actions/checkout@v4 with: - ref: ${{ steps.tag.outputs.tag }} + ref: ${{ inputs.tag }} - name: Install uv run: | @@ -66,7 +57,7 @@ jobs: run: | which jq || brew install jq REPO_API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}" - TAG="${{ steps.tag.outputs.tag }}" + TAG="${RELEASE_TAG}" echo "Waiting for sidecar release ${TAG} to be available..." for i in $(seq 1 30); do diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 4000e28..f7c4329 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -159,9 +159,7 @@ jobs: echo " Deleting release ${TAG} (ID: ${ID})..." curl -s -X DELETE -H "Authorization: token ${BUILD_TOKEN}" \ "${REPO_API}/releases/${ID}" - - # Also delete the tag - curl -s -X DELETE -H "Authorization: token ${BUILD_TOKEN}" \ - "${REPO_API}/tags/${TAG}" + # Keep the git tag -- only delete the release (assets). + # Deleting tags breaks builds that haven't checked out yet. done echo "Cleanup complete" diff --git a/.gitea/workflows/sidecar-release.yml b/.gitea/workflows/sidecar-release.yml index 30bdc7f..f8df662 100644 --- a/.gitea/workflows/sidecar-release.yml +++ b/.gitea/workflows/sidecar-release.yml @@ -166,9 +166,7 @@ jobs: echo " Deleting sidecar release ${TAG} (ID: ${ID})..." curl -s -X DELETE -H "Authorization: token ${BUILD_TOKEN}" \ "${REPO_API}/releases/${ID}" - - # Also delete the tag - curl -s -X DELETE -H "Authorization: token ${BUILD_TOKEN}" \ - "${REPO_API}/tags/${TAG}" + # Keep the git tag -- only delete the release (assets). + # Deleting tags breaks builds that haven't checked out yet. done echo "Cleanup complete"