Skip to content

Commit

Permalink
Update build and release configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tphakala committed Mar 17, 2024
1 parent 5325119 commit bfb4427
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -19,15 +19,6 @@ jobs:
go-version: 1.22
check-latest: true

- name: Clean up dist directory
run: rm -rf dist/

- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean --snapshot

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
57 changes: 48 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,57 @@ before:
hooks:
- go mod tidy
- go generate ./...

# Define builds for Linux and Windows
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
- binary: birdnet-pi2go
env:
- CGO_ENABLED=0
ldflags:
- -s -w
flags:
- -trimpath
goos:
- linux
- windows
goarch:
- amd64
- arm64
goarm:
- '7'
ignore:
- goos: windows
goarch: arm64

# Package the Linux builds into .deb
nfpms:
- id: default
package_name: birdnet-pi2go

vendor: "Tomi P. Hakala"
homepage: "https://github.com/tphakala/birdnet-pi2go"
maintainer: "Tomi P. Hakala <[email protected]>"
description: "BirdNET-Pi2Go is a data migration tool designed to facilitate the conversion of BirdNET-Pi database contents and audio files to the BirdNET-Go data model."
license: "MIT"

formats:
- deb

bindir: "/usr/local/bin"

# Archive configuration for both Linux and Windows
archives:
- format: tar.gz
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
- id: birdnet-pi2go
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
format: tar.gz
format_overrides:
- goos: windows
format: zip

# Include checksums for all artifacts
checksum:
name_template: 'checksums.txt'

# Configuration for snapshot releases
snapshot:
name_template: "{{ .Tag }}-next"

0 comments on commit bfb4427

Please sign in to comment.