Skip to content

Commit

Permalink
Merge 5921ed8 into e44a70b
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 committed Nov 6, 2023
2 parents e44a70b + 5921ed8 commit 8e2a564
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: On Release

on:
release:
types: [published]

jobs:
update-version-file:
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install gobump
run: go install github.com/x-motemen/gobump/cmd/gobump@latest

- name: Echo the release tag
run: |
echo "The release tag is: ${{ github.event.release.tag_name }}"
- name: Checkout master branch
uses: actions/checkout@v4
with:
ref: 'master'

- name: Configure Git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Commit and push linebot/version.go to master
run: |
VERSION=${{ github.event.release.tag_name }}
VERSION=${VERSION#v}
gobump set $VERSION -w -v linebot
git add linebot/version.go
git commit -m "Update version.go with tag information for ${{ github.event.release.tag_name }}"
git push
- name: Get the latest commit SHA
run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Force tag update to the latest commit
run: |
git tag -fa ${{ github.event.release.tag_name }} -m "Update tag for ${{ github.event.release.tag_name }}" ${{ env.sha }}
git push origin ${{ github.event.release.tag_name }} --force

0 comments on commit 8e2a564

Please sign in to comment.