Skip to content

Commit

Permalink
update release worker
Browse files Browse the repository at this point in the history
  • Loading branch information
caioricciuti committed May 18, 2024
1 parent c7e1fea commit 7c50c35
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ jobs:
git config --global user.email [email protected]
- name: Get current version
id: vars
run: |
set -e # Fail on first error
# Extract the latest tag, or default to v0.0.0
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` || echo "v0.0.0")
# Extract the latest tag, or default to v1.0.0
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` || echo "v1.0.0")
echo "Latest tag: $latest_tag"
echo "::set-output name=latest_tag::$latest_tag"
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
# Split the tag into parts
IFS='.' read -r -a parts <<< "${latest_tag//v/}"
Expand All @@ -38,22 +37,21 @@ jobs:
new_patch=$((patch + 1))
new_tag="v$major.$minor.$new_patch"
echo "New tag: $new_tag"
echo "::set-output name=new_tag::$new_tag"
echo "new_tag=$new_tag" >> $GITHUB_ENV
- name: Create new tag
run: |
set -e # Fail on first error
new_tag=${{ steps.vars.outputs.new_tag }}
git tag $new_tag
git push origin $new_tag
git tag ${{ env.new_tag }}
git push origin ${{ env.new_tag }}
- name: Create GitHub release
uses: actions/create-release@v1
with:
tag_name: ${{ steps.vars.outputs.new_tag }}
release_name: ${{ steps.vars.outputs.new_tag }}
body: "Automated release for tag ${{ steps.vars.outputs.new_tag }}"
tag_name: ${{ env.new_tag }}
release_name: ${{ env.new_tag }}
body: "Automated release for tag ${{ env.new_tag }}"
draft: false
prerelease: false
token: ${{ secrets.GHCR_PAT_PUB_RELEASE }}
token: ${{ secrets.GHCR_PAT }}

0 comments on commit 7c50c35

Please sign in to comment.