Skip to content

Release

Release #5

Workflow file for this run

name: Release
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.23.0]
os: [linux]
arch: [amd64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go mod tidy
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 1
run: |
CGO_ENABLED=1 CGO_LDFLAGS="-L/usr/lib" go build -o output/${{ matrix.os }}_${{ matrix.arch }}/hypha --ldflags="-extldflags=-static" -tags osusergo,netgo main.go
tar -C output/${{ matrix.os }}_${{ matrix.arch }} -czvf hypha-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz output/${{ matrix.os }}_${{ matrix.arch }}/hypha
echo "Built for $GOOS $GOARCH"
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
file: output/${{ matrix.os }}_${{ matrix.arch }}/hypha-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
build-macos:
runs-on: macos-latest
strategy:
matrix:
go-version: [1.23.0]
os: [darwin]
arch: [arm64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: go mod tidy
- name: Build
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
CGO_ENABLED: 1
run: |
CGO_ENABLED=1 CGO_LDFLAGS="-L/usr/lib" go build -o output/${{ matrix.os }}_${{ matrix.arch }}/hypha main.go
tar -C output/${{ matrix.os }}_${{ matrix.arch }} -czvf hypha-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz output/${{ matrix.os }}_${{ matrix.arch }}/hypha
echo "Built for $GOOS $GOARCH"
- name: Upload binaries
uses: svenstaro/upload-release-action@v2
with:
file: output/${{ matrix.os }}_${{ matrix.arch }}/hypha-${{ matrix.os }}_${{ matrix.arch }}-${{ github.event.release.tag_name }}.tar.gz
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}