Split the releases into a MacOS one and Linux/Windows one

This is to add support for building the MacOS binary using CGO.
This commit is contained in:
Leon Mika 2022-11-18 22:14:33 +11:00 committed by GitHub
parent 0c541da1c6
commit 55b8103416
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 74 additions and 26 deletions

View file

@ -11,7 +11,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack

View file

@ -4,10 +4,9 @@ on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: macos-12
build:
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack
@ -32,12 +31,51 @@ jobs:
go test -p 1 ./...
env:
GOPRIVATE: "github:com/lmika/*"
release-macos:
needs: build
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Configure
run: |
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/lmika".insteadOf "https://github.com/lmika"
- name: Setup Goreleaser
run: |
brew install goreleaser/tap/goreleaser
brew install goreleaser
- name: Release
if: startsWith(github.ref, 'refs/tags/')
run: |
goreleaser release -f macos.goreleaser.yml --snapshot --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_TOKEN }}
release-linux:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Configure
run: |
git config --global url."https://${{ secrets.GO_MODULES_TOKEN }}:x-oauth-basic@github.com/lmika".insteadOf "https://github.com/lmika"
- name: Release
uses: goreleaser/goreleaser-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --skip-validate --rm-dist
args: release --skip-validate --rm-dist --skip-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_GITHUB_TOKEN: ${{ secrets.HOMEBREW_GITHUB_TOKEN }}

View file

@ -3,8 +3,6 @@ builds:
targets:
- windows_amd64
- linux_amd64
- darwin_amd64
- darwin_arm64
env:
- CGO_ENABLED=1
main: ./cmd/dynamo-browse/.
@ -19,8 +17,6 @@ archives:
format: zip
- goos: linux
format: tar.gz
- goos: macos
format: tar.gz
nfpms:
- id: package_nfpms
package_name: audax
@ -35,23 +31,7 @@ nfpms:
- deb
- rpm
bindir: /usr/local/bin
brews:
- name: audax
tap:
owner: lmika
name: homebrew-audax
token: "{{ .Env.HOMEBREW_GITHUB_TOKEN }}"
folder: Formula
homepage: https://audax.tools
description: TUI tools for AWS administration
license: MIT
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
name_template: "{{ .Tag }}-next"

31
macos.goreleaser.yml Normal file
View file

@ -0,0 +1,31 @@
builds:
- id: dynamo-browse
targets:
- darwin_amd64
- darwin_arm64
env:
- CGO_ENABLED=1
main: ./cmd/dynamo-browse/.
binary: dynamo-browse
archives:
- id: zip
builds:
- dynamo-browse
wrap_in_directory: true
format_overrides:
- goos: macos
format: tar.gz
brews:
- name: audax
tap:
owner: lmika
name: homebrew-audax
token: "{{ .Env.HOMEBREW_GITHUB_TOKEN }}"
folder: Formula
homepage: https://audax.tools
description: TUI tools for AWS administration
license: MIT
checksum:
name_template: 'checksums-macos.txt'
snapshot:
name_template: "{{ .Tag }}-next"