-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup GoReleaser for app distribution.
- Loading branch information
Showing
5 changed files
with
109 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: [ubuntu-latest] | ||
|
||
steps: | ||
- name: checkout the code | ||
uses: actions/checkout@v3 | ||
|
||
- name: setup go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21.x' | ||
|
||
- name: unshallow | ||
run: git fetch --prune --unshallow | ||
|
||
- name: run goreleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ cover* | |
vendor | ||
build | ||
data/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This is an example .goreleaser.yml file with some sensible defaults. | ||
# Make sure to check the documentation at https://goreleaser.com | ||
project_name: "movies" | ||
before: | ||
hooks: | ||
- go mod tidy | ||
- make clean | ||
|
||
builds: | ||
- id: movies | ||
main: ./cmd/movies/ | ||
binary: movies | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
goarch: | ||
- amd64 | ||
ldflags: | ||
- "-s" | ||
- "-w" | ||
- "-X main.appVersion={{ .Version }}" | ||
- "-X main.osArch={{ .Os }}/{{ .Arch }}" | ||
|
||
archives: | ||
- id: movies | ||
format: tar.gz | ||
builds: | ||
- movies | ||
name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else }}{{ .Arch }}{{ end }} | ||
nfpms: | ||
- id: movies | ||
builds: | ||
- movies | ||
package_name: movies | ||
file_name_template: "{{ .ConventionalFileName }}" | ||
vendor: Fabio Ribeiro | ||
homepage: https://fabioribeiro.dev | ||
maintainer: Fabio Ribeiro <me@fabioribeiro.dev> | ||
description: Manages movie collection throught API | ||
license: MIT | ||
formats: | ||
- deb | ||
|
||
checksum: | ||
name_template: '{{ .ProjectName }}_checksums.txt' | ||
|
||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters