Skip to content

Commit a57e9df

Browse files
ci(ipa): create release tag in IPA ruleset release
1 parent cbdd1f6 commit a57e9df

File tree

1 file changed

+37
-8
lines changed

1 file changed

+37
-8
lines changed

.github/workflows/ipa-release.yml

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
type: boolean
99
required: false
1010
default: true
11+
use_existing_tag:
12+
description: 'Set value to `true` to use an existing tag for the release process, default is `false`'
13+
default: 'false'
1114
push:
1215
branches:
1316
- main
@@ -19,6 +22,7 @@ jobs:
1922
runs-on: ubuntu-latest
2023
outputs:
2124
version_changed: ${{ steps.version_check.outputs.version_changed }}
25+
current_version: ${{ steps.version_check.outputs.current_version }}
2226

2327
steps:
2428
- name: Checkout Repository
@@ -31,12 +35,36 @@ jobs:
3135
- name: Fetch Versions
3236
id: version_check
3337
env:
34-
BASE_BRANCH: "main~1"
38+
BASE_BRANCH: "CLOUDP-337866~1"
3539
run: |
3640
version_changed=$(./.github/scripts/ipa_version_check.sh)
3741
echo "Version changed? ${version_changed}"
3842
echo "version_changed=${version_changed}" >> "${GITHUB_OUTPUT}"
39-
43+
echo "current_version=${jq -r '.version' tools/spectral/ipa/package.json} >> "${GITHUB_OUTPUT}"
44+
45+
create-tag:
46+
runs-on: ubuntu-latest
47+
needs: check-version
48+
if: >-
49+
!cancelled()
50+
&& inputs.use_existing_tag == 'false'
51+
steps:
52+
- name: Validation of version format
53+
run: |
54+
echo "${{ needs.check-version.outputs.current_version }}" | grep -P '^\d+\.\d+\.\d+$'
55+
- name: Checkout
56+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
57+
- name: Get the latest commit SHA
58+
id: get-sha
59+
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
60+
- name: Create release tag
61+
uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72
62+
with:
63+
tag: 'ipa-validation-ruleset-v${{ inputs.version_number }}'
64+
commit_sha: ${{ steps.get-sha.outputs.sha }}
65+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
66+
gpg_passphrase: ${{ secrets.PASSPHRASE }}
67+
4068
publish:
4169
needs: check-version
4270
runs-on: ubuntu-latest
@@ -50,10 +78,11 @@ jobs:
5078
with:
5179
node-version: '20.x'
5280
registry-url: 'https://registry.npmjs.org'
53-
- run: npm ci
54-
working-directory: tools/spectral/ipa
55-
- run: npm publish --access public
56-
working-directory: tools/spectral/ipa
57-
env:
58-
NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_NPM_TOKEN }}
81+
- run: echo "Skipping release"
82+
# - run: npm ci
83+
# working-directory: tools/spectral/ipa
84+
# - run: npm publish --access public
85+
# working-directory: tools/spectral/ipa
86+
# env:
87+
# NODE_AUTH_TOKEN: ${{ secrets.IPA_VALIDATION_NPM_TOKEN }}
5988

0 commit comments

Comments
 (0)