Skip to content

Commit

Permalink
CI: create release if version bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
yhsphd committed Jun 4, 2024
1 parent c6ededd commit 5bd2975
Showing 1 changed file with 37 additions and 17 deletions.
54 changes: 37 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,6 @@ jobs:
node-version: 18.x
cache: "npm"

######################
# Check Version Bump #
######################

- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2

- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'

- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: 'echo "No version change :/"'

#########
# Build #
#########
Expand Down Expand Up @@ -66,4 +50,40 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: kdc-overlay
path: dist/kdc-overlay.exe
path: dist/

######################
# Check Version Bump #
######################

- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2

- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'

- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: 'echo "No version change :/"'

############################
# Create Release if Bumped #
############################

- name: Download build artifacts
if: steps.check.outputs.changed == 'true'
id: download-artifact
uses: dawidd6/action-download-artifact@v4
with:
skip_unpack: true

- name: Release
if: steps.check.outputs.changed == 'true'
uses: softprops/action-gh-release@v2
with:
name: v${{ steps.check.outputs.version }}
tag_name: v${{ steps.check.outputs.version }}
generate_release_notes: true
files: kdc-overlay.zip

0 comments on commit 5bd2975

Please sign in to comment.