From 436d159fb1411134aefc8ee2596b925388167703 Mon Sep 17 00:00:00 2001 From: lqqyt2423 <974923609@qq.com> Date: Sun, 21 Nov 2021 18:10:00 +0800 Subject: [PATCH] add release action --- .github/workflows/release.yml | 27 +++++++++++++++++++++++++++ .gitignore | 2 ++ .goreleaser.yml | 33 +++++++++++++++++++++++++++++++++ go.mod | 2 +- 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9ca4b08 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: version tag to release + required: true +jobs: + setup: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 34633a3..341ce9e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ .env /go-mitmproxy /dummycert + +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..4791825 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,33 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + # - go mod tidy + # you may remove this if you don't need go generate + # - go generate ./... +builds: + - env: + - CGO_ENABLED=0 + main: ./cmd/go-mitmproxy/main.go + goos: + - linux + - windows + - darwin +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/go.mod b/go.mod index f32f3c9..f19d7c7 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/lqqyt2423/go-mitmproxy -go 1.16 +go 1.17 require ( github.com/andybalholm/brotli v1.0.4