Skip to content

Commit

Permalink
Added automatic releases
Browse files Browse the repository at this point in the history
  • Loading branch information
emmaly committed Feb 20, 2025
1 parent 6345f10 commit 2243be3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release Go Binary

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Important for git history

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

- name: Get latest tag
id: get_latest_tag
run: |
git fetch --tags
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null || echo "v0.0.0")
echo "Latest tag: $latest_tag"
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
- name: Bump version
id: bump_version
run: |
current_version=${LATEST_TAG#v} # Remove 'v' prefix
IFS='.' read -ra version_parts <<< "$current_version"
new_patch=$((version_parts[2] + 1))
new_version="${version_parts[0]}.${version_parts[1]}.$new_patch"
echo "NEW_VERSION=v$new_version" >> $GITHUB_ENV
echo "New version will be: v$new_version"
- name: Build
run: |
GOOS=windows GOARCH=amd64 go build -o musicstate-windows-amd64.exe
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.NEW_VERSION }}
name: Release ${{ env.NEW_VERSION }}
draft: false
prerelease: false
files: |
musicstate-windows-amd64.exe
body: |
Automated release ${{ env.NEW_VERSION }}
Changes in this release:
${{ github.event.head_commit.message }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/emmaly/musicstate

go 1.23.1
go 1.24

require github.com/gorilla/websocket v1.5.3

0 comments on commit 2243be3

Please sign in to comment.