-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c7e1fea
commit 7c50c35
Showing
1 changed file
with
10 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/}" | ||
|
@@ -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 }} |