-
Notifications
You must be signed in to change notification settings - Fork 104
86 lines (78 loc) · 2.87 KB
/
release-ios-runner.yml
File metadata and controls
86 lines (78 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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 Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
node-version: "22"
- 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