Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ on:
types: [completed]
jobs:
bin-releaser:
name: Release Binaries
runs-on: ubuntu-latest
name: Release Binaries (${{ matrix.runner }})
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
config: .goreleaser.yaml
needs_zig: true
- runner: macos-latest
config: .goreleaser.darwin.yaml
needs_zig: false
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,11 +29,22 @@ jobs:
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
# curl zig directly; setup-zig actions have unreliable mirror pools
- name: Set up Zig
if: matrix.needs_zig
run: |
set -eu
ZV=0.14.1
curl -sL https://ziglang.org/download/${ZV}/zig-x86_64-linux-${ZV}.tar.xz -o /tmp/zig.tar.xz
mkdir -p "$HOME/zig-${ZV}"
tar -xJf /tmp/zig.tar.xz -C "$HOME/zig-${ZV}" --strip-components=1
echo "$HOME/zig-${ZV}" >> "$GITHUB_PATH"
"$HOME/zig-${ZV}/zig" version
- name: Release Binaries
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: ${{ github.event_name == 'pull_request' && 'release --snapshot --skip-publish' || 'release --clean' }}
args: release --clean --config ${{ matrix.config }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .goreleaser.darwin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: 2

project_name: singularity

builds:
- id: singularity-darwin
env:
- CGO_ENABLED=1
binary: singularity
goos:
- darwin
goarch:
- amd64
- arm64
mod_timestamp: '{{.CommitTimestamp}}'

archives:
- format_overrides:
- goos: darwin
formats: [zip]
name_template: '{{ .ProjectName }}_{{ .Version }}_mac_os_{{ .Arch }}'
files:
- LICENSE
- README.md
- docs/*

release:
mode: keep-existing

changelog:
disable: true

checksum:
name_template: 'checksums-darwin.txt'
disable: false
36 changes: 27 additions & 9 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,45 @@
version: 2

builds:
- env:
- CGO_ENABLED=0
- id: singularity-nixwin
env:
- CGO_ENABLED=1
binary: singularity
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
overrides:
- goos: linux
goarch: amd64
env:
- CC=zig cc -target x86_64-linux-gnu
- CXX=zig c++ -target x86_64-linux-gnu
- goos: linux
goarch: arm64
env:
- CC=zig cc -target aarch64-linux-gnu
- CXX=zig c++ -target aarch64-linux-gnu
- goos: windows
goarch: amd64
env:
- CC=zig cc -target x86_64-windows-gnu
- CXX=zig c++ -target x86_64-windows-gnu
- goos: windows
goarch: arm64
env:
- CC=zig cc -target aarch64-windows-gnu
- CXX=zig c++ -target aarch64-windows-gnu
mod_timestamp: '{{.CommitTimestamp}}'

archives:
- format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
formats: [zip]
name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{- if eq .Os "darwin" }}mac_os
{{- else }}{{ .Os }}{{ end }}_{{ .Arch }}
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
files:
- LICENSE
- README.md
Expand All @@ -35,6 +52,7 @@ changelog:
disable: true

checksum:
name_template: 'checksums-nixwin.txt'
disable: false

nfpms:
Expand Down
Loading