Skip to content

Commit

Permalink
Try add release action
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed May 31, 2024
1 parent fb12969 commit 123dae8
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
56 changes: 56 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# to test
# docker run -ti -v "$PWD:$PWD" -w "$PWD" goreleaser/goreleaser:latest release --snapshot --rm-dist
project_name: ansisvg

before:
hooks:
- go mod download

release:
draft: true

builds:
- env:
- CGO_ENABLED=0
goarch:
- amd64
- arm64
goos:
- linux
- windows
- darwin
flags:
- -trimpath
ldflags:
# omit symbol table and debug information
- -s -w
- -X main.version={{.Version}}
- -X main.commit={{.Commit}}
- -X main.date={{.CommitDate}}
- -X main.builtBy=goreleaser
checksum:
name_template: "checksums.txt"

archives:
- files:
# skip all other files
- none*
format_overrides:
- goos: windows
format: zip
- goos: darwin
format: zip
# name_1.2.3_linux_amd64.tar.gz
# name_1.2.3_macos_arm64.zip
name_template: >-
{{ .ProjectName }}_
{{- .Version }}_
{{- if eq .Os "darwin" }}macos_
{{- else }}{{ .Os }}_{{ end }}
{{- .Arch }}
changelog:
sort: asc
filters:
exclude:
- "^Merge"

0 comments on commit 123dae8

Please sign in to comment.