Skip to content

docs: add README with install instructions; inject version in release… #125

docs: add README with install instructions; inject version in release…

docs: add README with install instructions; inject version in release… #125

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
name: Build ${{ matrix.goos }}/${{ matrix.goarch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
asset_name: scud-linux-amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
asset_name: scud-linux-arm64
- os: macos-latest
goos: darwin
goarch: amd64
asset_name: scud-darwin-amd64
- os: macos-latest
goos: darwin
goarch: arm64
asset_name: scud-darwin-arm64
- os: windows-latest
goos: windows
goarch: amd64
asset_name: scud-windows-amd64.exe
- os: windows-latest
goos: windows
goarch: arm64
asset_name: scud-windows-arm64.exe
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: "0"
run: go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" -o ${{ matrix.asset_name }} ./cmd/scud/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.asset_name }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts
- name: Create Release
run: gh release create ${{ github.ref_name }} --title "${{ github.ref_name }}" --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release Assets
run: |
for asset_dir in ./artifacts/*; do
if [ -d "$asset_dir" ]; then
asset_name=$(basename "$asset_dir")
asset_file=$(find "$asset_dir" -type f -name "scud*" | head -1)
if [ -n "$asset_file" ]; then
echo "Uploading $asset_file as $asset_name"
cp "$asset_file" "./$asset_name"
gh release upload ${{ github.ref_name }} "./$asset_name" --clobber
fi
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}