diff --git a/.github/workflows/gameci.yml b/.github/workflows/gameci.yml index 06dbeb34..dbd42c7b 100644 --- a/.github/workflows/gameci.yml +++ b/.github/workflows/gameci.yml @@ -94,4 +94,9 @@ jobs: if: always() with: name: Coverage results - path: ${{ steps.gameci.outputs.coveragePath }} \ No newline at end of file + path: ${{ steps.gameci.outputs.coveragePath }} + tag-release: + if: github.ref == 'refs/heads/main' && github.repository == 'bdunderscore/ndmf' + permissions: + contents: write + uses: bdunderscore/ndmf/.github/workflows/release-tagging.yml@main \ No newline at end of file diff --git a/.github/workflows/release-tagging.yml b/.github/workflows/release-tagging.yml index ce97be51..6fe2d579 100644 --- a/.github/workflows/release-tagging.yml +++ b/.github/workflows/release-tagging.yml @@ -1,8 +1,6 @@ name: Tag releases on: - push: - branches: - - main + workflow_call: permissions: contents: write @@ -19,13 +17,21 @@ jobs: - name: Check if version is tagged id: check_tagged run: | - if git tag -l $current_version; then + if git tag -l $current_version | grep .; then echo "Version $current_version is already tagged" echo "need_tag=false" >> $GITHUB_OUTPUT else echo "Version $current_version is not tagged" echo "need_tag=true" >> $GITHUB_OUTPUT fi + - name: Verify that this is the first revision with this version + if: steps.check_tagged.outputs.need_tag == 'true' + run: | + git checkout HEAD~ package.json + if [ "$(jq -r .version package.json)" == "$current_version" ]; then + echo "Error: Looks like we skipped the version bump commit." + exit 1 + fi - name: Tag version if: steps.check_tagged.outputs.need_tag == 'true' run: |