This document explains how to create releases for the Serve project.
To enable automated releases, you need to manually create the GitHub Actions workflow file, as it cannot be pushed via automated tools due to GitHub security restrictions.
- Go to your GitHub repository
- Click on "Actions" tab
- Click "New workflow"
- Click "set up a workflow yourself"
- Name the file:
.github/workflows/release.yml - Paste the following content:
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: linux
goarch: amd64
output: koryx-serv-linux-amd64
- goos: linux
goarch: arm64
output: koryx-serv-linux-arm64
- goos: darwin
goarch: amd64
output: koryx-serv-darwin-amd64
- goos: darwin
goarch: arm64
output: koryx-serv-darwin-arm64
- goos: windows
goarch: amd64
output: koryx-serv-windows-amd64.exe
- goos: windows
goarch: arm64
output: koryx-serv-windows-arm64.exe
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build binary
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
run: |
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o ${{ matrix.output }}
- name: Create archive (Unix)
if: matrix.goos != 'windows'
run: |
tar -czf ${{ matrix.output }}.tar.gz ${{ matrix.output }} README.md LICENSE config.example.json
sha256sum ${{ matrix.output }}.tar.gz > ${{ matrix.output }}.tar.gz.sha256
- name: Create archive (Windows)
if: matrix.goos == 'windows'
run: |
zip ${{ matrix.output }}.zip ${{ matrix.output }} README.md LICENSE config.example.json
sha256sum ${{ matrix.output }}.zip > ${{ matrix.output }}.zip.sha256
- name: Upload Release Asset (Unix)
if: matrix.goos != 'windows'
uses: softprops/action-gh-release@v1
with:
files: |
${{ matrix.output }}.tar.gz
${{ matrix.output }}.tar.gz.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Asset (Windows)
if: matrix.goos == 'windows'
uses: softprops/action-gh-release@v1
with:
files: |
${{ matrix.output }}.zip
${{ matrix.output }}.zip.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- Commit the file
Once the workflow is set up, create a release by pushing a tag:
# Create a tag
git tag -a v1.0.0 -m "Release v1.0.0"
# Push the tag
git push origin v1.0.0The GitHub Action will automatically:
- Build binaries for all platforms (Linux, macOS, Windows on amd64 and arm64)
- Create
.tar.gzarchives for Unix systems - Create
.ziparchives for Windows - Generate SHA256 checksums
- Upload all files to the GitHub Release
If you prefer to create releases manually, use the Makefile:
make build-allThis creates binaries in ./dist/:
koryx-serv-linux-amd64koryx-serv-linux-arm64koryx-serv-darwin-amd64koryx-serv-darwin-arm64koryx-serv-windows-amd64.exekoryx-serv-windows-arm64.exe
make release-localThis creates archives in ./dist/archives/:
koryx-serv-linux-amd64.tar.gzkoryx-serv-linux-arm64.tar.gzkoryx-serv-darwin-amd64.tar.gzkoryx-serv-darwin-arm64.tar.gzkoryx-serv-windows-amd64.zipkoryx-serv-windows-arm64.zip
- Go to your repository on GitHub
- Click "Releases"
- Click "Draft a new release"
- Create a new tag (e.g.,
v1.0.0) - Set the release title (e.g.,
Release v1.0.0) - Add release notes (copy from CHANGELOG.md)
- Upload the archive files from
./dist/archives/ - Publish the release
- Linux (amd64, arm64)
- macOS (amd64 - Intel, arm64 - Apple Silicon)
- Windows (amd64, arm64)
Optimized binaries (with -ldflags="-s -w"):
- Approximately 7-8 MB per binary
- No external dependencies required
- Stripped symbols and debug info
This project follows Semantic Versioning:
- MAJOR: Incompatible API changes
- MINOR: Backwards-compatible functionality additions
- PATCH: Backwards-compatible bug fixes
For pre-releases, use:
v1.0.0-alpha.1- Alpha releasesv1.0.0-beta.1- Beta releasesv1.0.0-rc.1- Release candidates
Before creating a release:
- Update CHANGELOG.md with changes
- Update version in relevant documentation
- Run tests (when available)
- Build and test locally:
make build-all - Verify all features work
- Update README.md if needed
- Create git tag
- Push tag to trigger release
- Verify release artifacts on GitHub
- Test download and installation
- Announce release (if applicable)
Check that:
- Go 1.21+ is installed
- All dependencies are available
- No syntax errors in code
Ensure these files exist:
README.mdLICENSEconfig.example.json
Verify:
- Workflow file is in
.github/workflows/ - Tag starts with
v(e.g.,v1.0.0) - Repository has Actions enabled
- Workflow has
contents: writepermission