update ipa release workflow to use version check script #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
| fetch-depth: 0 | ||
| sparse-checkout: | | ||
| tools/spectral/ipa | ||
| .github/scripts | ||
| - name: Check Version Bump | ||
| working-directory: tools/spectral/ipa | ||
| id: version_check | ||
| run: | | ||
| chmod +x ./.github/scripts/ipa_version_check.sh | ||
| version_changed=$(./.github/scripts/ipa_version_check.sh) | ||
| echo "Version changed? ${version_changed}" | ||
| if [[ ${{ version_changed }} == "false" ]]; 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 }} | ||