Skip to content

Commit

Permalink
write git tag during publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Sep 11, 2024
1 parent 604caf5 commit 7fb6c76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.read_version.outputs.value }}
needs_release: ${{ steps.create_tag.outputs.tag_existed != 'true' }}
permissions:
contents: write
steps:
Expand All @@ -26,6 +27,7 @@ jobs:

- name: Create tag
id: create_tag
if: ${{ steps.create_tag.outputs.tag_existed != 'true' }}
uses: actions/github-script@v7
with:
script: |
Expand All @@ -45,7 +47,7 @@ jobs:
});
tagExisted = true;
core.notice(`Release skipped as tag '${tag}' already exists. Update the version in '${{ env.APP_CARGO_TOML }}' to perform a release.`);
core.notice(`Release skipped as tag '${tag}' already exists. Update the version in '${{ env.APP_CARGO_TOML }}' before starting another release.`);
} catch (error) {
if ("status" in error && error.status === 404) tagExisted = false;
else throw error;
Expand All @@ -72,6 +74,7 @@ jobs:

build:
needs: draft
if: ${{ needs.draft.outputs.needs_release == 'true' }}
permissions:
contents: write
runs-on: macos-latest
Expand Down

0 comments on commit 7fb6c76

Please sign in to comment.