Skip to content

Commit

Permalink
Merge pull request #443 from Crown-Commercial-Service/update-release-…
Browse files Browse the repository at this point in the history
…action

Update the release action
  • Loading branch information
tim-s-ccs authored Aug 27, 2024
2 parents 0d49bda + 3ec8186 commit 8e13aa9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,26 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Check to see if the package version has changed
id: check-package-version
uses: EndBug/version-check@v2.1.4

- name: Echo change
run: 'echo "Changed: ${{ steps.check-package-version.outputs.changed }}"'
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: "https://registry.npmjs.org"

- name: End if no changes where found
run: 'echo "CANCELLING WORKFLOW: No package version changes found"'
if: steps.check-package-version.outputs.changed == 'false'
- name: Get package version
id: package_version
run: echo "npm=$(npm run version --silent)" >> $GITHUB_OUTPUT

- name: Log when changed
run: 'echo "New version: ${{ steps.check-package-version.outputs.version }} (${{ steps.check-package-version.outputs.type }})"'
if: steps.check-package-version.outputs.changed == 'true'
- name: Check if version tag already exists
id: version_tag
uses: mukunku/tag-exists-action@bdad1eaa119ce71b150b952c97351c75025c06a9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: v${{ steps.package_version.outputs.npm }}

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.check-package-version.outputs.version }}
tag_name: v${{ steps.package_version.outputs.npm }}
generate_release_notes: true
if: steps.check-package-version.outputs.changed == 'true'
if: steps.version_tag.outputs.exists == 'false'
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/iron

0 comments on commit 8e13aa9

Please sign in to comment.