Skip to content

v0.1.4-bsd

v0.1.4-bsd #66

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build release
on:
release:
types:
- created
- edited
permissions:
contents: write
packages: write
jobs:
gorelease:
strategy:
matrix:
variant: [ { imgname: ubuntu-latest, releaserfile: linux-amd64 }, { imgname: ubuntu-latest, releaserfile: linux-arm64 }, { imgname: ubuntu-latest, releaserfile: unix }, { imgname: ubuntu-latest, releaserfile: client-only-windows } ]
runs-on: ${{ matrix.variant.imgname }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get musl source
run: sudo apt-get -y install wget && pushd /tmp && sudo wget -O musl-1.2.4.tar.gz https://git.musl-libc.org/cgit/musl/snapshot/musl-1.2.4.tar.gz && tar xzvf musl-1.2.4.tar.gz && popd
- name: Compile and install musl
run: pushd /tmp/musl-1.2.4 && ./configure --prefix=/usr/local/musl/ && make && sudo make install && popd
- name: Get musl cross-compiler for arm64
run: wget -O /tmp/aarch64-linux-musl-cross.tgz https://musl.cc/aarch64-linux-musl-cross.tgz
- name: Untar musl cross-compiler for arm64
run: tar -C /tmp/ -x -z -f /tmp/aarch64-linux-musl-cross.tgz
- name: Ensure musl gcc can run
run: /tmp/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc --version
- name: Set a different ld for each arch # ugly but there are no working flags to explicitly set the ld to use...
run: sudo cp /usr/bin/x86_64-linux-gnu-ld /usr/bin/amd64-ld && sudo cp /tmp/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc /usr/bin/arm64-ld
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.x'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --verbose --clean --config .goreleaser-${{ matrix.variant.releaserfile }}.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}