workflows/dispatch-build-bottle: fix for ephemeral

master
Bo Anderson 2022-07-19 14:38:47 +01:00 committed by GitHub
parent bf952b2d21
commit 343cb9fa39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 3 deletions

View File

@ -40,9 +40,17 @@ jobs:
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
script: | script: |
const intelMacOSRegex = /^\d+(?:\.\d+)?$/;
return context.payload.inputs.runner.split(",") return context.payload.inputs.runner.split(",")
.map(s => s.trim()) .map(s => s.trim())
.filter(Boolean); .filter(Boolean)
.map(s => {
if (intelMacOSRegex.test(s)) // Ephemeral runners
return `${s}-${context.runId}-${process.env.GITHUB_RUN_ATTEMPT}`
else
return s
});
bottle: bottle:
needs: prepare needs: prepare
strategy: strategy:
@ -71,8 +79,6 @@ jobs:
if: runner.os == 'macOS' if: runner.os == 'macOS'
run: | run: |
echo 'PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' >> $GITHUB_ENV echo 'PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' >> $GITHUB_ENV
# TODO: remove the line below once set in the runner .env file
echo 'GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED=1' >> $GITHUB_ENV
- name: Run Docker container - name: Run Docker container
if: runner.os == 'Linux' if: runner.os == 'Linux'