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
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
# Trigger after release-linux completes (it uploads amd64 tarball)
|
||||
workflow_run:
|
||||
workflows: ["release-linux"]
|
||||
types: [completed]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
@@ -18,7 +20,8 @@ on:
|
||||
jobs:
|
||||
update-aur:
|
||||
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:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -26,22 +29,24 @@ jobs:
|
||||
- name: Determine version
|
||||
id: version
|
||||
run: |
|
||||
if [[ "${{ github.event_name }}" == "release" ]]; then
|
||||
VERSION="${{ github.event.release.tag_name }}"
|
||||
VERSION="${VERSION#v}"
|
||||
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
|
||||
# Extract version from the triggering workflow's head branch (tag)
|
||||
REF="${{ github.event.workflow_run.head_branch }}"
|
||||
VERSION="${REF#v}"
|
||||
else
|
||||
VERSION="${{ inputs.version }}"
|
||||
fi
|
||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "Detected version: $VERSION"
|
||||
|
||||
- name: Wait for release assets
|
||||
if: github.event_name == 'release'
|
||||
- name: Wait for all release assets
|
||||
env:
|
||||
VERSION: ${{ steps.version.outputs.version }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
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
|
||||
ELAPSED=0
|
||||
|
||||
@@ -63,7 +68,7 @@ jobs:
|
||||
done
|
||||
|
||||
if [ $ELAPSED -ge $MAX_WAIT ]; then
|
||||
echo "Timeout waiting for release assets"
|
||||
echo "Timeout waiting for release assets after 30 minutes"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user