Skip to content

Commit

Permalink
Add MacOs release
Browse files Browse the repository at this point in the history
  • Loading branch information
phwissmann committed Nov 14, 2024
1 parent a13eb42 commit f2ee285
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,28 @@ jobs:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
goreleaser-darwin:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Set up Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean --config .goreleaser_macos.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ builds:
post:
- dir: cmd/openem-ingestor-app
cmd: wails build -platform {{ .Os }} -clean -ldflags "-s -w -X 'main.version={{.Version}}'" -trimpath -o {{base .Path}}
output: true
- dir: cmd/openem-ingestor-app
cmd: cp build/bin/{{base .Path}} {{dir .Path}}/
output: true
env:
- CGO_ENABLED=0
dir: ./cmd/openem-ingestor-app
goos:
- linux
- windows
- darwin
goarch:
- amd64
main: .
Expand Down
77 changes: 77 additions & 0 deletions .goreleaser_macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj


# Test with `goreleaser --snapshot --clean`
# To release, create a tag and push it to Github: `git tag -a v0.1.0 -m "First release" && git push origin v0.1.0`. GoReleaser enforces semantic versioning and will error on non-compliant tags.
# For it to work, you need to have the `GITHUB_TOKEN` environment variable set export GITHUB_TOKEN="YOUR_GH_TOKEN". The minimum permissions the GITHUB_TOKEN should have to run this are write:packages

# Now you can run GoReleaser at the root of your repository: `goreleaser release`
# For dry run, see https://goreleaser.com/quick-start/#dry-run

version: 2

before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...

builds:
# The app build is invoked via wails and binary copied manually to the expected output folder
- id: "openem-ingestor-app"
hooks:
pre:
- cmd: mkdir {{dir .Path}}
post:
- dir: cmd/openem-ingestor-app
cmd: wails build -platform {{ .Os }} -clean -ldflags "-s -w -X 'main.version={{.Version}}'" -trimpath -o {{base .Path}}
output: true
- dir: cmd/openem-ingestor-app
cmd: cp build/bin/openem-ingestor-app.app/Contents/MacOS/{{base .Path}} {{dir .Path}}/
output: true
env:
- CGO_ENABLED=0
dir: ./cmd/openem-ingestor-app
goos:
- darwin
goarch:
- amd64
main: .
binary: openem-ingestor-app
gobinary: echo

archives:
- id: "openem-ingestor-app"
builds:
- openem-ingestor-app
format: tar.gz

wrap_in_directory: true
name_template: >-
{{ .ProjectName }}_app_
{{- .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# use zip for windows archives
files:
- src: configs/*.yaml
dst: ./
- src: configs/schemas/*.json
dst: schemas

changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

release:
prerelease: auto
Empty file.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ require (
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/labstack/echo/v4 v4.11.4 // indirect
github.com/labstack/gommon v0.4.2
github.com/labstack/gommon v0.4.2 // indirect
github.com/leaanthony/go-ansi-parser v1.6.0 // indirect
github.com/leaanthony/gosod v1.0.3 // indirect
github.com/leaanthony/slicer v1.6.0 // indirect
Expand Down

0 comments on commit f2ee285

Please sign in to comment.