Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/scripts/ipa_version_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -eou pipefail

current_version=$(jq -r '.version' tools/spectral/ipa/package.json)

previous_version=$(git show origin/"${BASE_BRANCH}":tools/spectral/ipa/package.json | jq -r '.version')

if [[ -z "$previous_version" || "$previous_version" == "null" ]]; then
previous_version="none"
fi

if [[ "$previous_version" == "$current_version" ]]; then
echo "false"
else
echo "true"
fi
22 changes: 9 additions & 13 deletions .github/workflows/ipa-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,22 @@
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
sparse-checkout: |
tools/spectral/ipa
tools/spectral/ipa
.github/scripts

- name: Fetch Versions
working-directory: tools/spectral/ipa
id: version_check
env:
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
run: |

Check failure on line 25 in .github/workflows/ipa-changelog.yml

View workflow job for this annotation

GitHub Actions / lint

shellcheck reported issue in this script: SC2086:info:4:44: Double quote to prevent globbing and word splitting
current_version=$(jq '.version' package.json)
echo "Current version: $current_version"

previous_version=$(git show origin/${{ github.event.pull_request.base.ref }}:tools/spectral/ipa/package.json | jq -r '.version')

if [[ -z "$previous_version" || "$previous_version" == "null" ]]; then
previous_version="none"
fi
echo "Previous version: $previous_version"

chmod +x ./.github/scripts/ipa_version_check.sh
version_changed=$(./.github/scripts/ipa_version_check.sh)
echo "Version changed? $version_changed"
echo "version_changed=$version_changed" >> $GITHUB_OUTPUT
- name: Check Changelog
working-directory: tools/spectral/ipa
env:
VERSION_BUMP: ${{ steps.version_check.outputs.current_version != steps.version_check.outputs.previous_version && 'true' || 'false' }}
VERSION_BUMP: ${{ steps.version_check.outputs.version_changed }}
run: |
npm run gen-ipa-changelog

Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/ipa-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Release IPA Package

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'tools/spectral/ipa/package.json'

jobs:
check-version:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
sparse-checkout: |
tools/spectral/ipa
- name: Check Version Bump
working-directory: tools/spectral/ipa
id: version_check
run: |
current_version=$(jq '.version' package.json)
echo "Current version: $current_version"
previous_version=$(git show origin/${{ github.event.pull_request.base.ref }}:tools/spectral/ipa/package.json | jq -r '.version')
if [[ -z "$previous_version" || "$previous_version" == "null" ]]; then
previous_version="none"
fi
echo "Previous version: $previous_version"

if [[ "$previous_version" == "$current_version" ]]; then
echo "No version bump to release".
exit 0
fi
publish:
needs: check-version
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
working-directory: tools/spectral/ipa
- run: npm publish --access public
working-directory: tools/spectral/ipa
env:
NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_TOKEN }}
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ When working in the `tools/cli` directory:
- `make e2e-test` - Run end-to-end tests
- `make build` - Build the CLI binary
- `make gen-docs` - Generate CLI documentation

**Note: Please ensure the usage of [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) in PR titles**
Loading
Loading