diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a033d9d40d76..8a20bf9cb8442 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: - { image: ubuntu-24.04-arm, asset_name_suffix: "-aarch64", arch: "arm64" } version: - { use_patch: true, asset_name: "gcc-15-without-int128" } - - { use_path: false, asset_name: "gcc-15" } + - { use_patch: false, asset_name: "gcc-15" } steps: - uses: actions/checkout@v2 @@ -63,13 +63,18 @@ jobs: - name: Create tag if: github.ref == 'refs/heads/master' - continue-on-error: true env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh api repos/${{ github.repository }}/git/refs \ - -f ref=refs/tags/master-$GITHUB_SHA \ - -f sha=$GITHUB_SHA + if ! error=$(gh api repos/${{ github.repository }}/git/refs \ + -f ref=refs/tags/master-$GITHUB_SHA \ + -f sha=$GITHUB_SHA --silent 2>&1); then + # The other matrix jobs create the same tag, so only one of them wins the race. + case $error in + *"Reference already exists"*) echo "Tag master-$GITHUB_SHA already created by another job." ;; + *) echo "$error" >&2; exit 1 ;; + esac + fi - name: Create release if: github.ref == 'refs/heads/master' && !matrix.version.use_patch