From 0a5caab064e4df0ba77c3488cf93012666c4c2d7 Mon Sep 17 00:00:00 2001 From: LaurensBartelds Date: Fri, 24 Apr 2026 09:30:21 +0200 Subject: [PATCH] fix: derive release tag from Gitea API instead of head_branch --- .gitea/workflows/deploy.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index fa7287b..426f08c 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -32,9 +32,17 @@ jobs: "${{ secrets.ANSIBLE_USER }}" > /tmp/inventory.ini - name: Download ARM Release Artifacts + env: + GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SERVER_URL: ${{ github.server_url }} + REPOSITORY: ${{ github.repository }} run: | - TAG="${{ github.event.workflow_run.head_branch }}" - BASE_URL="${{ github.server_url }}/${{ github.repository }}/releases/download/${TAG}" + TAG=$(curl -sf \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${SERVER_URL}/api/v1/repos/${REPOSITORY}/releases?limit=1&page=1" \ + | python3 -c "import sys, json; print(json.load(sys.stdin)[0]['tag_name'])") + echo "Deploying release tag: ${TAG}" + BASE_URL="${SERVER_URL}/${REPOSITORY}/releases/download/${TAG}" wget --fail -q "${BASE_URL}/brainwave-arm64.tar.gz" || { echo "Failed to download ARM tarball from ${BASE_URL}"; exit 1; } wget --fail -q "${BASE_URL}/docker-compose.arm64.yml" || { echo "Failed to download docker-compose file from ${BASE_URL}"; exit 1; }