release with github actions and goreleaser. also add some love for Mac M1 (darwin arm64) and windows arm builds (just in case)

This commit is contained in:
Filipe Pina 2022-07-06 15:38:55 +01:00
parent 004fea55f7
commit 4d8d5600d3
No known key found for this signature in database
GPG Key ID: 6B11B25EADA6E27E
4 changed files with 85 additions and 0 deletions

35
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Release
on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
# to be used by fork patch-releases ^^
- 'v*.*.*-*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/dist

49
.goreleaser.yml Normal file
View File

@ -0,0 +1,49 @@
project_name: boringproxy
# release:
# If set to auto, will mark the release as not ready for production
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
# If set to true, will mark the release as not ready for production.
# Default is false.
#
# leaving as false for now as all releases are "beta" but they should be full releases
# prerelease: auto
builds:
- main: ./cmd/boringproxy
env:
- CGO_ENABLED=0
goos:
- freebsd
- windows
- darwin
- linux
goarch:
- amd64
- arm64
- arm
- '386'
goarm:
- '7'
ignore:
- goos: darwin
goarch: '386'
- goos: darwin
goarch: arm
goarm: '7'
ldflags:
- -s -w -X main.Version={{.Version}}
archives:
- format: binary
snapshot:
name_template: "{{ .Tag }}"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- '^Merge pull request'

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB