-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (56 loc) · 2.21 KB
/
Copy pathrelease.yml
File metadata and controls
64 lines (56 loc) · 2.21 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
# Publish the Alpha CLI tarball and the packable npm CLI when a version
# tag is pushed. After merge, create the matching tag (example:
# v0.1.0-alpha.1). This workflow does not build or attach the macOS app.
name: Release CLI
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
name: attach CLI and npm packages
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Require tag to match package.json
run: |
expected="v$(node -p "require('./package.json').version")"
if [[ "${GITHUB_REF_NAME}" != "$expected" ]]; then
echo "Tag ${GITHUB_REF_NAME} does not match package.json (${expected})." >&2
exit 1
fi
- name: Public Node test surface
run: |
npm run verify:public-surface
npm run test:broker-core
npm run test:client
npm run test:harness-adoption
- name: Package CLI tarball and npm CLI
run: |
npm run package:cli
npm run package:npm
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
version="$(node -p "require('./package.json').version")"
asset="artifacts/cli/simulator-broker-${version}-cli.tar.gz"
checksum="${asset}.sha256"
npm_asset="artifacts/npm/simbroker-${version}.tgz"
prerelease_args=()
if [[ "$version" == *alpha* || "$version" == *beta* || "$version" == *rc* ]]; then
prerelease_args+=(--prerelease)
fi
gh release create "${GITHUB_REF_NAME}" \
--title "Simulator Broker ${GITHUB_REF_NAME}" \
--notes "Alpha CLI. Install with \`brew install fiveonecode/simulator-broker/simbroker\` or \`npm install -g\` the attached \`simbroker-${version}.tgz\`. Node.js 20 or newer is required. macOS and Xcode are still required to create and run iOS Simulators. A signed, notarized operator app is not attached. See CHANGELOG.md." \
"${prerelease_args[@]}" \
"$asset" \
"$checksum" \
"$npm_asset"