Browse Source

Added verifying version before creating release

pull/290/head
Jeppe Rask 3 years ago
parent
commit
3e361c3c2c
2 changed files with 14 additions and 5 deletions
  1. +5
    -5
      .github/workflows/release.yml
  2. +9
    -0
      ci/verifyVersion.sh

+ 5
- 5
.github/workflows/release.yml View File

@ -27,19 +27,19 @@ jobs:
zip -r -j static.zip dist/*
- name: Get version
run: echo "::set-output name=version::$(./ci/getVersion.sh)"
run: echo "::set-output name=version::v$(./ci/getVersion.sh)"
id: version
# - name: Verify version
# run: |
# ./ci/verifyVersion.sh
- name: Verify version
run: |
./ci/verifyVersion.sh ${{ steps.version.outputs.version }}
# Verify changelog has entry with new version
- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.version.outputs.version }}
tag_name: v${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
files: static.zip
fail_on_unmatched_files: true
prerelease: false

+ 9
- 0
ci/verifyVersion.sh View File

@ -0,0 +1,9 @@
VERSION=$1
TAG_EXISTS=$(git ls-remote --tags origin $VERSION | wc -l)
if [ $TAG_EXISTS -eq "1" ]; then
echo "The tag '$VERSION' already exists. Please update version in package.json.";
exit 1;
fi
echo "The tag '$VERSION' does not exist - success.";

Loading…
Cancel
Save