feat: clean up html readability; add autm. tag creation
This commit is contained in:
parent
857b23c3fd
commit
689292f7f6
@ -1,4 +1,4 @@
|
|||||||
name: Update Version and Create Tag
|
name: Update Version File and Create Tag
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -28,30 +28,28 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
|
||||||
echo "Latest tag is: $latest_tag"
|
echo "Latest tag is: $latest_tag"
|
||||||
echo "::set-output name=tag::$latest_tag"
|
echo "tag=$latest_tag" >> $GITHUB_ENV # Save the latest tag to environment file
|
||||||
|
|
||||||
- name: Increment minor version
|
- name: Increment patch version
|
||||||
id: increment_version
|
id: increment_version
|
||||||
run: |
|
run: |
|
||||||
latest_tag=${{ steps.get_latest_tag.outputs.tag }}
|
IFS='.' read -r major minor patch <<<"${{ env.tag#v }}"
|
||||||
IFS='.' read -r major minor patch <<<"${latest_tag#v}"
|
new_patch=$((patch + 1))
|
||||||
new_minor=$((minor + 1))
|
new_tag="v${major}.${minor}.${new_patch}"
|
||||||
new_tag="v${major}.${new_minor}.0"
|
|
||||||
echo "New tag is: $new_tag"
|
echo "New tag is: $new_tag"
|
||||||
echo "::set-output name=new_tag::$new_tag"
|
echo "new_tag=$new_tag" >> $GITHUB_ENV # Save the new tag to environment file
|
||||||
|
|
||||||
- name: Update version.go file
|
- name: Update version.go file
|
||||||
run: |
|
run: |
|
||||||
new_tag=${{ steps.increment_version.outputs.new_tag }}
|
|
||||||
commit_hash=$(git rev-parse --short HEAD)
|
commit_hash=$(git rev-parse --short HEAD)
|
||||||
echo "package main" > version.go
|
echo "package main" > version.go
|
||||||
echo "" >> version.go
|
echo "" >> version.go
|
||||||
echo "var version = \"${new_tag}-${commit_hash}\"" >> version.go
|
echo "var version = \"${{ env.new_tag }}-${commit_hash}\"" >> version.go
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
run: |
|
run: |
|
||||||
git add version.go
|
git add version.go
|
||||||
git commit -m "Update version to ${{ steps.increment_version.outputs.new_tag }} and commit $commit_hash"
|
git commit -m "Update version to ${{ env.new_tag }} and commit $commit_hash"
|
||||||
|
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
env:
|
env:
|
||||||
@ -63,6 +61,5 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
new_tag=${{ steps.increment_version.outputs.new_tag }}
|
git tag ${{ env.new_tag }}
|
||||||
git tag $new_tag
|
git push origin ${{ env.new_tag }} # Push the new tag
|
||||||
git push origin $new_tag # Push the new tag
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user