Merge pull request #15 from droidrun/timo/fix-prebuild-r2-tunnel #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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: | |
| # DO NOT USE 26.4+ for a while since it could drop lower iOS versions forcefully | |
| # while the project config allows such lower versions. | |
| # (at least WDA failed to start on iOS 15) | |
| # Xcode 26.3 looks like it's working as expected. | |
| XCODE_VERSION: '16.4' | |
| # Available destination for simulators depends 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@v4 | |
| 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@v7 | |
| 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@v8 | |
| with: | |
| path: ${{ runner.temp }}/artifacts-temp | |
| - name: Move artifacts to root for release | |
| run: | | |
| find "${{ runner.temp }}/artifacts-temp" -name "*.zip" -type f -exec mv {} . \; | |
| rm -rf "${{ runner.temp }}/artifacts-temp" | |
| - run: npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| name: Release | |