57 lines
1.6 KiB
YAML
57 lines
1.6 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: "Version number (e.g. v1.2.0)"
|
|
required: true
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
|
|
- name: Build binaries
|
|
run: |
|
|
mkdir dist
|
|
GOOS=linux GOARCH=amd64 go build -trimpath -o dist/text-shark-linux-amd64 .
|
|
GOOS=linux GOARCH=arm64 go build -trimpath -o dist/text-shark-linux-arm64 .
|
|
GOOS=darwin GOARCH=arm64 go build -trimpath -o dist/text-shark-darwin-arm64 .
|
|
GOOS=windows GOARCH=amd64 go build -trimpath -o dist/text-shark-windows-amd64.exe .
|
|
|
|
- name: Generate checksums
|
|
id: checksums
|
|
run: |
|
|
cd dist
|
|
sha256sum text-shark-linux-amd64 text-shark-linux-arm64 text-shark-darwin-arm64 text-shark-windows-amd64.exe \
|
|
| tee checksums.txt
|
|
{
|
|
echo 'body<<EOF'
|
|
echo '## SHA256 Checksums'
|
|
echo '```'
|
|
cat checksums.txt
|
|
echo '```'
|
|
echo 'EOF'
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Create release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: ${{ inputs.version }}
|
|
name: ${{ inputs.version }}
|
|
body: ${{ steps.checksums.outputs.body }}
|
|
files: |
|
|
dist/text-shark-linux-amd64
|
|
dist/text-shark-linux-arm64
|
|
dist/text-shark-darwin-arm64
|
|
dist/text-shark-windows-amd64.exe
|
|
dist/checksums.txt
|