v0.1.6-rc1 #75
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
# 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@v5 | |
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 }} |