Fix AUR workflow to trigger after release-linux completes
- Change trigger from release:published to workflow_run on release-linux - Only run if the triggering workflow succeeded - Increase timeout to 30 minutes for aarch64 build to complete - Extract version from workflow's head branch (the tag)
This commit is contained in:
1 parent
f70000bbcc
commit
7926e3eaa5
1 file changed
+15
-10
@@ -1,8 +1,10 @@
|
|||||||
name: release-aur
|
name: release-aur
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
# Trigger after release-linux completes (it uploads amd64 tarball)
|
||||||
types: [published]
|
workflow_run:
|
||||||
|
workflows: ["release-linux"]
|
||||||
|
types: [completed]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
@@ -18,7 +20,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
update-aur:
|
update-aur:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: []
|
# Only run if the triggering workflow succeeded (or manual dispatch)
|
||||||
|
if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -26,22 +29,24 @@ jobs:
|
|||||||
- name: Determine version
|
- name: Determine version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
|
||||||
VERSION="${{ github.event.release.tag_name }}"
|
# Extract version from the triggering workflow's head branch (tag)
|
||||||
VERSION="${VERSION#v}"
|
REF="${{ github.event.workflow_run.head_branch }}"
|
||||||
|
VERSION="${REF#v}"
|
||||||
else
|
else
|
||||||
VERSION="${{ inputs.version }}"
|
VERSION="${{ inputs.version }}"
|
||||||
fi
|
fi
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Detected version: $VERSION"
|
||||||
|
|
||||||
- name: Wait for release assets
|
- name: Wait for all release assets
|
||||||
if: github.event_name == 'release'
|
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ steps.version.outputs.version }}
|
VERSION: ${{ steps.version.outputs.version }}
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
echo "Waiting for release assets to be available..."
|
echo "Waiting for release assets to be available..."
|
||||||
MAX_WAIT=600
|
echo "Note: amd64 should be ready (release-linux completed), waiting for aarch64..."
|
||||||
|
MAX_WAIT=1800
|
||||||
INTERVAL=30
|
INTERVAL=30
|
||||||
ELAPSED=0
|
ELAPSED=0
|
||||||
|
|
||||||
@@ -63,7 +68,7 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
if [ $ELAPSED -ge $MAX_WAIT ]; then
|
if [ $ELAPSED -ge $MAX_WAIT ]; then
|
||||||
echo "Timeout waiting for release assets"
|
echo "Timeout waiting for release assets after 30 minutes"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user