mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
87 lines
2.8 KiB
YAML
87 lines
2.8 KiB
YAML
name: Release iOS Runner
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_tag:
|
|
description: GitHub Release tag to upload assets to, for example v0.12.6.
|
|
required: true
|
|
type: string
|
|
checkout_ref:
|
|
description: Optional branch, tag, or commit SHA to build. Defaults to the selected workflow ref.
|
|
required: false
|
|
type: string
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
publish-ios-simulator-runner:
|
|
name: Publish iOS Simulator Runner
|
|
runs-on: macos-26
|
|
timeout-minutes: 90
|
|
env:
|
|
AGENT_DEVICE_XCUITEST_PLATFORM: ios
|
|
AGENT_DEVICE_XCUITEST_DESTINATION: generic/platform=iOS Simulator
|
|
AGENT_DEVICE_IOS_CLEAN_DERIVED: '1'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
ref: ${{ github.event.inputs.checkout_ref || github.ref }}
|
|
|
|
- name: Setup toolchain
|
|
uses: ./.github/actions/setup-node-pnpm
|
|
with:
|
|
node-version: '24.13'
|
|
|
|
- name: Resolve release metadata
|
|
id: meta
|
|
run: |
|
|
set -euo pipefail
|
|
PACKAGE_VERSION="$(node -p "JSON.parse(require('node:fs').readFileSync('package.json', 'utf8')).version")"
|
|
TAG_NAME="${{ github.event.release.tag_name || github.event.inputs.release_tag }}"
|
|
VERSION="${TAG_NAME#v}"
|
|
if [ "$VERSION" != "$PACKAGE_VERSION" ]; then
|
|
echo "Release tag $TAG_NAME does not match package.json version $PACKAGE_VERSION" >&2
|
|
exit 1
|
|
fi
|
|
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
|
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
|
shell: bash
|
|
|
|
- name: Build iOS simulator runner
|
|
env:
|
|
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH: ${{ github.workspace }}/.tmp/ios-runner-derived
|
|
run: sh ./scripts/build-xcuitest-apple.sh
|
|
shell: bash
|
|
|
|
- name: Package iOS simulator runner
|
|
id: package
|
|
env:
|
|
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH: ${{ github.workspace }}/.tmp/ios-runner-derived
|
|
RELEASE_ASSET_DIR: ${{ github.workspace }}/.tmp/release-assets
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p "${RELEASE_ASSET_DIR}"
|
|
sh ./scripts/package-ios-simulator-runner.sh \
|
|
"${{ steps.meta.outputs.version }}" \
|
|
"${{ steps.meta.outputs.tag }}" \
|
|
"${RELEASE_ASSET_DIR}"
|
|
shell: bash
|
|
|
|
- name: Upload runner assets to GitHub Release
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
set -euo pipefail
|
|
gh release upload "${{ steps.meta.outputs.tag }}" \
|
|
"${{ steps.package.outputs.archive_path }}" \
|
|
"${{ steps.package.outputs.checksum_path }}" \
|
|
"${{ steps.package.outputs.manifest_path }}" \
|
|
--clobber
|
|
shell: bash
|