Skip to content

ci: Retry WDA release build (#1093) #343

ci: Retry WDA release build (#1093)

ci: Retry WDA release build (#1093) #343

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Release
on:
workflow_dispatch:
push:
branches: [ master ]
permissions:
contents: write
pull-requests: write
issues: write
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
env:
XCODE_VERSION: '16.4'
# Available destination for simulators depend on Xcode version.
DESTINATION_SIM: platform=iOS Simulator,name=iPhone 17
DESTINATION_SIM_TVOS: platform=tvOS Simulator,name=Apple TV 4K (3rd generation)
jobs:
build_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
cat <<MATRIX_JSON | jq -c . > matrix.json
[
{"name": "iOS Real Device", "build_script": "build-real.sh", "scheme": "WebDriverAgentRunner", "destination": "generic/platform=iOS", "derived_data_path": "appium_wda_ios", "wd": "appium_wda_ios/Build/Products/Debug-iphoneos", "zip_name": "WebDriverAgentRunner-Runner.zip", "artifact_name": "WebDriverAgentRunner-Runner"},
{"name": "tvOS Real Device", "build_script": "build-real.sh", "scheme": "WebDriverAgentRunner_tvOS", "destination": "generic/platform=tvOS", "derived_data_path": "appium_wda_tvos", "wd": "appium_wda_tvos/Build/Products/Debug-appletvos", "zip_name": "WebDriverAgentRunner_tvOS-Runner.zip", "artifact_name": "WebDriverAgentRunner_tvOS-Runner"},
{"name": "iOS Simulator arm64", "build_script": "build-sim.sh", "scheme": "WebDriverAgentRunner", "destination": "${{ env.DESTINATION_SIM }}", "derived_data_path": "appium_wda_ios_sim_arm64", "simulator_name": "Debug-iphonesimulator", "wd": "appium_wda_ios_sim_arm64/Build/Products/Debug-iphonesimulator", "zip_name": "WebDriverAgentRunner-Build-Sim-arm64.zip", "artifact_name": "WebDriverAgentRunner-Build-Sim-arm64", "archs": "arm64"},
{"name": "iOS Simulator x86_64", "build_script": "build-sim.sh", "scheme": "WebDriverAgentRunner", "destination": "${{ env.DESTINATION_SIM }}", "derived_data_path": "appium_wda_ios_sim_x86_64", "simulator_name": "Debug-iphonesimulator", "wd": "appium_wda_ios_sim_x86_64/Build/Products/Debug-iphonesimulator", "zip_name": "WebDriverAgentRunner-Build-Sim-x86_64.zip", "artifact_name": "WebDriverAgentRunner-Build-Sim-x86_64", "archs": "x86_64"},
{"name": "tvOS Simulator arm64", "build_script": "build-sim.sh", "scheme": "WebDriverAgentRunner_tvOS", "destination": "${{ env.DESTINATION_SIM_TVOS }}", "derived_data_path": "appium_wda_tvos_sim_arm64", "simulator_name": "Debug-appletvsimulator", "wd": "appium_wda_tvos_sim_arm64/Build/Products/Debug-appletvsimulator", "zip_name": "WebDriverAgentRunner_tvOS-Build-Sim-arm64.zip", "artifact_name": "WebDriverAgentRunner_tvOS-Build-Sim-arm64", "archs": "arm64"},
{"name": "tvOS Simulator x86_64", "build_script": "build-sim.sh", "scheme": "WebDriverAgentRunner_tvOS", "destination": "${{ env.DESTINATION_SIM_TVOS }}", "derived_data_path": "appium_wda_tvos_sim_x86_64", "simulator_name": "Debug-appletvsimulator", "wd": "appium_wda_tvos_sim_x86_64/Build/Products/Debug-appletvsimulator", "zip_name": "WebDriverAgentRunner_tvOS-Build-Sim-x86_64.zip", "artifact_name": "WebDriverAgentRunner_tvOS-Build-Sim-x86_64", "archs": "x86_64"}
]
MATRIX_JSON
echo "matrix=$(cat matrix.json)" >> $GITHUB_OUTPUT
build-wda:
needs: build_matrix
name: ${{ matrix.config.name }}
runs-on: macos-15
strategy:
fail-fast: false
matrix:
config: ${{ fromJSON(needs.build_matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "${{ env.XCODE_VERSION }}"
- name: ${{ matrix.config.name }}
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: |
export DERIVED_DATA_PATH="${{ matrix.config.derived_data_path }}"
export SCHEME="${{ matrix.config.scheme }}"
export DESTINATION="${{ matrix.config.destination }}"
export WD="${{ matrix.config.wd }}"
export ZIP_PKG_NAME="${{ matrix.config.zip_name }}"
export ARCHS="${{ matrix.config.archs || '' }}"
sh $GITHUB_WORKSPACE/Scripts/ci/${{ matrix.config.build_script }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.artifact_name }}
path: ${{ matrix.config.zip_name }}
release:
needs: build-wda
runs-on: macos-15
steps:
- uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
node-version: lts/*
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "${{ env.XCODE_VERSION }}"
- run: npm install --no-package-lock
name: Install dev dependencies
- run: npm run build
name: Run build
- run: npm run test
name: Run test
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Release