windows STILL wont use env #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://github.com/badboy/mdbook-toc/blob/main/.github/workflows/deploy.yml | |
name: Release binaries | |
concurrency: | |
group: release | |
cancel-in-progress: true | |
env: | |
REPO_NAME: schemgo | |
on: | |
push: | |
tags: | |
- "v*" | |
# branches: | |
# - main | |
jobs: | |
github_build: | |
name: Build binaries | |
strategy: | |
fail-fast: false | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-unknown-linux-musl | |
- x86_64-apple-darwin | |
- aarch64-apple-darwin | |
- x86_64-pc-windows-msvc | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
name: x86_64-unknown-linux-gnu.tar.gz | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
name: x86_64-unknown-linux-musl.tar.gz | |
- target: x86_64-apple-darwin | |
os: macOS-latest | |
name: x86_64-apple-darwin.tar.gz | |
- target: aarch64-apple-darwin | |
os: macOS-latest | |
name: aarch64-apple-darwin.tar.gz | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
name: x86_64-pc-windows-msvc.zip | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 'stable' | |
- name: Build | |
run: go build -ldflags "-s -w" -o build/${{ env.REPO_NAME }}-${{ matrix.target }} | |
- name: Post Setup | Strip binaries (-nix) | |
if: matrix.os != 'windows-latest' | |
run: | | |
strip build/${REPO_NAME}-${{ matrix.target }}${{ matrix.ext }} | |
- name: Post Setup | Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.REPO_NAME }}-${{ matrix.target }} | |
path: build/* | |
github_release: | |
name: Create GitHub Release | |
needs: github_build | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts/. | |
- run: tree | |
- name: Setup | Generate release notes | |
run: git log -1 --pretty='%s' > RELEASE.md | |
- name: Build | Publish | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: artifacts/** | |
body_path: RELEASE.md |