Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: use osxcross for better cross compiling support #146

Closed
wants to merge 3 commits into from
Closed
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
17 changes: 7 additions & 10 deletions .github/workflows/bump-cask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,11 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: "1.20"
- uses: mislav/bump-homebrew-formula-action@v2
- name: Bump Homebrew tap
uses: macauley/action-homebrew-bump-cask@v1
with:
formula-name: cf-vault
formula-path: Casks/cf-vault.rb
homebrew-tap: jacobbednarz/homebrew-tap
base-branch: master
download-url: https://github.com/jacobbednarz/cf-vault/releases/download/${{ github.event.inputs.tag-name }}/cf-vault_${{ github.event.inputs.tag-name }}_darwin_amd64.zip
commit-message: Bump {{formulaName}} to {{version}}
tag-name: ${{ github.event.inputs.tag-name }}
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_UPDATER_PAT }}
token: ${{ secrets.HOMEBREW_UPDATER_PAT }}
tap: jacobbednarz/homebrew-tap
cask: cf-vault
livecheck: true
dryrun: false
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,22 @@ jobs:
uses: actions/setup-go@v3
with:
go-version: "1.20"
- name: OSXCross for CGO Support
run: |
mkdir ../../osxcross
git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: mislav/bump-homebrew-formula-action@v2
- name: Bump Homebrew tap
uses: macauley/action-homebrew-bump-cask@v1
with:
formula-name: cf-vault
formula-path: Casks/cf-vault.rb
homebrew-tap: jacobbednarz/homebrew-tap
base-branch: master
download-url: https://github.com/jacobbednarz/cf-vault/releases/download/${{ steps.extract-version.outputs.tag-name }}/cf-vault_${{ steps.extract-version.outputs.tag-name }}_darwin_amd64.zip
commit-message: Bump {{formulaName}} to {{version}}
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_UPDATER_PAT }}
token: ${{ secrets.HOMEBREW_UPDATER_PAT }}
tap: jacobbednarz/homebrew-tap
cask: cf-vault
livecheck: true
dryrun: false
33 changes: 27 additions & 6 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
builds:
- env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
# - id: linux-build
# flags:
# - -trimpath
# asmflags:
# - all=-trimpath=$GOPATH
# gcflags:
# - all=-trimpath=$GOPATH
# ldflags:
# - -s -w -X github.com/jacobbednarz/cf-vault/cmd.Rev={{ .Version }}
# env:
# - CGO_ENABLED=1
# goos:
# - linux
# ignore:
# - goos: linux
# goarch: "386"
- id: darwin-build
flags:
- -trimpath
asmflags:
Expand All @@ -10,16 +24,23 @@ builds:
- all=-trimpath=$GOPATH
ldflags:
- -s -w -X github.com/jacobbednarz/cf-vault/cmd.Rev={{ .Version }}
env:
- CGO_ENABLED=1
- CC=/home/runner/work/osxcross/target/bin/o64-clang
- CXX=/home/runner/work/osxcross/target/bin/o64-clang++
goos:
- darwin
- freebsd
- linux
- windows
ignore:
- goos: darwin
goarch: "386"

archives:
- format: zip
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'

checksum:
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
algorithm: sha256

changelog:
skip: true
Loading