Skip to content

Commit

Permalink
ci: debugging tag workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bdunderscore committed Sep 23, 2023
1 parent e1591d9 commit 7517fd0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/gameci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,9 @@ jobs:
if: always()
with:
name: Coverage results
path: ${{ steps.gameci.outputs.coveragePath }}
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
14 changes: 10 additions & 4 deletions .github/workflows/release-tagging.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Tag releases
on:
push:
branches:
- main
workflow_call:

permissions:
contents: write
Expand All @@ -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: |
Expand Down

0 comments on commit 7517fd0

Please sign in to comment.