diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e6c05e9 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..4fc0386 --- /dev/null +++ b/.goreleaser.yml @@ -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"