Skip to content

Commit

Permalink
Merge pull request #82 from authzed/musl
Browse files Browse the repository at this point in the history
.github: fix release APKs by adding musl builds
  • Loading branch information
jzelinskie authored Jan 31, 2022
2 parents d94404a + b522c48 commit 3923a38
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 17 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ jobs:
- name: "Install cross-compilers"
run: |
brew tap messense/macos-cross-toolchains
brew install x86_64-unknown-linux-gnu
brew install aarch64-unknown-linux-gnu
brew install mingw-w64
brew install x86_64-unknown-linux-gnu x86_64-unknown-linux-musl aarch64-unknown-linux-gnu aarch64-unknown-linux-musl mingw-w64
echo "SDKROOT=$(xcrun --sdk macosx --show-sdk-path)" >> $GITHUB_ENV
- uses: "actions/setup-go@v2"
with:
Expand All @@ -42,8 +40,7 @@ jobs:
username: "${{ secrets.QUAY_USERNAME }}"
password: "${{ secrets.QUAY_ROBOT_TOKEN }}"
- name: "Install linux cross-compilers"
run: |
sudo apt-get install -y gcc-aarch64-linux-gnu gcc-mingw-w64-x86-64
run: "sudo apt-get install -y gcc-aarch64-linux-gnu gcc-mingw-w64-x86-64"
- uses: "actions/setup-go@v2"
with:
go-version: "^1.17"
Expand Down
72 changes: 60 additions & 12 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
builds:
- id: "linux-amd64"
- id: "linux-amd64-gnu"
goos: ["linux"]
goarch: ["amd64"]
env: ["CC=x86_64-unknown-linux-gnu-gcc", "CGO_ENABLED=1"]
Expand All @@ -13,7 +13,18 @@ builds:
ldflags: &ldflags
- "-s -w"
- "-X {{ .ModulePath }}/internal/version.Version={{ .Version }}"
- id: "linux-arm64"
- id: "linux-amd64-musl"
goos: ["linux"]
goarch: ["amd64"]
env: ["CC=x86_64-unknown-linux-musl-gcc", "CGO_ENABLED=1"]
main: *main
binary: *binary
mod_timestamp: *mod_timestamp
flags: *flags
asmflags: *asmflags
gcflags: *gcflags
ldflags: *ldflags
- id: "linux-arm64-gnu"
goos: ["linux"]
goarch: ["arm64"]
env: ["CC=aarch64-unknown-linux-gnu-gcc", "CGO_ENABLED=1"]
Expand All @@ -24,6 +35,17 @@ builds:
asmflags: *asmflags
gcflags: *gcflags
ldflags: *ldflags
- id: "linux-arm64-musl"
goos: ["linux"]
goarch: ["arm64"]
env: ["CC=aarch64-unknown-linux-musl-gcc", "CGO_ENABLED=1"]
main: *main
binary: *binary
mod_timestamp: *mod_timestamp
flags: *flags
asmflags: *asmflags
gcflags: *gcflags
ldflags: *ldflags
- id: "windows-amd64"
goos: ["windows"]
goarch: ["amd64"]
Expand Down Expand Up @@ -58,23 +80,49 @@ builds:
gcflags: *gcflags
ldflags: *ldflags

archives:
- id: "gnu"
builds:
- "linux-amd64-gnu"
- "linux-arm64-gnu"
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}_gnu"
- id: "musl"
builds:
- "linux-amd64-musl"
- "linux-arm64-musl"
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}_musl"
- id: "other"
builds:
- "darwin-amd64"
- "darwin-arm64"
- "windows-amd64"

nfpms:
- vendor: "authzed inc."
homepage: "https://authzed.com/"
maintainer: "authzed <[email protected]>"
description: "manage Authzed from your command line."
license: "Apache 2.0"
epoch: 0
formats:
- "apk"
- "deb"
- "rpm"
- id: "gnu"
vendor: &vendor "authzed inc."
homepage: &homepage "https://authzed.com/"
maintainer: &maintainer "authzed <[email protected]>"
description: &description "manage Authzed from your command line."
license: &license "Apache 2.0"
epoch: &epoch "0"
builds: ["linux-amd64-gnu", "linux-arm64-gnu"]
formats: ["deb", "rpm"]
- id: "musl"
vendor: *vendor
homepage: *homepage
maintainer: *maintainer
description: *description
license: *license
epoch: *epoch
builds: ["linux-amd64-musl", "linux-arm64-musl"]
formats: ["apk"]

brews:
- tap:
owner: "authzed"
name: "homebrew-tap"
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
ids: ["gnu", "other"]
url_template: "https://github.com/authzed/zed/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
download_strategy: "CurlDownloadStrategy"
commit_author:
Expand Down

0 comments on commit 3923a38

Please sign in to comment.