Skip to content

Commit 850499d

Browse files
author
Sophia Marie Terry
committed
Draft ipa package release workflow
1 parent 9c748f4 commit 850499d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/ipa-release.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release IPA Package
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- 'tools/spectral/ipa/package.json'
10+
11+
jobs:
12+
check-version:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout Repository
17+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
18+
with:
19+
sparse-checkout: |
20+
tools/spectral/ipa
21+
22+
- name: Check Version Bump
23+
working-directory: tools/spectral/ipa
24+
id: version_check
25+
run: |
26+
current_version=$(jq '.version' package.json)
27+
echo "Current version: $current_version"
28+
29+
previous_version=$(git show origin/${{ github.event.pull_request.base.ref }}:tools/spectral/ipa/package.json | jq -r '.version')
30+
31+
if [[ -z "$previous_version" || "$previous_version" == "null" ]]; then
32+
previous_version="none"
33+
fi
34+
echo "Previous version: $previous_version"
35+
36+
if [["$previous_version" == "$current_version" ]]; then
37+
echo "No version bump to release".
38+
exit 0
39+
fi
40+
publish:
41+
needs: check-version
42+
runs-on: ubuntu-latest
43+
working-directory: tools/spectral/ipa
44+
permissions:
45+
contents: read
46+
id-token: write
47+
48+
steps:
49+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
50+
- uses: actions/setup-node@v4
51+
with:
52+
node-version: '20.x'
53+
registry-url: 'https://registry.npmjs.org'
54+
- run: npm ci
55+
- run: npm publish --access public
56+
env:
57+
NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_TOKEN }}

0 commit comments

Comments
 (0)