Skip to content

Release

Release #6

Workflow file for this run

name: Release
on:
release:
types: [created]
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
release:
name: Create Release
runs-on: 'ubuntu-latest'
strategy:
matrix:
# List of GOOS and GOARCH pairs
include:
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: windows
goarch: amd64
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get OS and arch info
run: |
BINARY_NAME=${{github.repository}}-${{ matrix.goos }}-${{ matrix.goarch }}
echo "BINARY_NAME=$BINARY_NAME" >> $GITHUB_ENV
echo "GOOS=${{ matrix.goos }}" >> $GITHUB_ENV
echo "GOARCH=${{ matrix.goarch }}" >> $GITHUB_ENV
- name: Build
run: |
go build -o "$BINARY_NAME" -v ./cmd
- name: Release Notes
run: |
git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n * %an <%ae>' --no-merges >> ".github/RELEASE-TEMPLATE.md"
- name: Release with Notes
uses: softprops/action-gh-release@v2
with:
body_path: ".github/RELEASE-TEMPLATE.md"
draft: true
files: ${{ env.BINARY_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}