v0.0.5 #9
Workflow file for this run
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
name: Release Build | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.20' | |
- name: Install dependencies | |
run: go mod tidy | |
- name: Execute build script | |
run: chmod +x ./build.sh && ./build.sh | |
- name: Get previous release tag | |
id: get_previous_release | |
run: | | |
PREV_TAG=$(git tag --sort=-v:refname | sed -n '2p') | |
echo "Previous release tag: $PREV_TAG" | |
echo "::set-output name=prev_tag::$PREV_TAG" | |
- name: Generate release notes | |
id: changelog | |
run: | | |
CURRENT_TAG=${{ github.event.release.tag_name }} | |
echo "Current release tag: $CURRENT_TAG" | |
commits=$(git log --format=format:"* %s" ${{ steps.get_previous_release.outputs.prev_tag }}..${CURRENT_TAG}) | |
echo "${commits}" > release_notes.txt | |
echo "::set-output name=notes::$(cat release_notes.txt)" | |
- name: Upload Release Assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ github.event.release.tag_name }} | |
files: release/*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |