Skip to content

Add CHANGELOG.md for v0.3.0 release #10

Add CHANGELOG.md for v0.3.0 release

Add CHANGELOG.md for v0.3.0 release #10

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Run go vet
run: go vet ./...
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
install-mode: "goinstall"
version: v1.64
build:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Get version
id: version
run: |
TAG="${GITHUB_REF#refs/tags/}"
if [[ "$TAG" == v* ]]; then
VERSION="$TAG"
else
VERSION="$(git rev-parse --short HEAD)"
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Build all platforms
env:
CGO_ENABLED: 0
VERSION: ${{ steps.version.outputs.VERSION }}
run: |
echo "version: $VERSION"
GOOS=linux GOARCH=amd64 go build -ldflags "-X github.com/liut/morign/pkg/settings.version=$VERSION -s -w" -o morign .
mv morign morign-linux-amd64
GOOS=darwin GOARCH=amd64 go build -ldflags "-X github.com/liut/morign/pkg/settings.version=$VERSION -s -w" -o morign .
mv morign morign-darwin-amd64
GOOS=darwin GOARCH=arm64 go build -ldflags "-X github.com/liut/morign/pkg/settings.version=$VERSION -s -w" -o morign .
mv morign morign-darwin-arm64
GOOS=windows GOARCH=amd64 go build -ldflags "-X github.com/liut/morign/pkg/settings.version=$VERSION -s -w" -o morign.exe .
mv morign.exe morign-windows-amd64.exe
- name: Package
run: |
tar -cvJf morign-linux-amd64-${{ steps.version.outputs.VERSION }}.tar.xz -C . morign-linux-amd64
tar -cvJf morign-darwin-amd64-${{ steps.version.outputs.VERSION }}.tar.xz -C . morign-darwin-amd64
tar -cvJf morign-darwin-arm64-${{ steps.version.outputs.VERSION }}.tar.xz -C . morign-darwin-arm64
zip morign-windows-amd64-${{ steps.version.outputs.VERSION }}.zip morign-windows-amd64.exe
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
morign-linux-amd64-*.tar.xz
morign-darwin-amd64-*.tar.xz
morign-darwin-arm64-*.tar.xz
morign-windows-amd64-*.zip
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}