diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..badafdf --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: 🎉 Release Binary +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Install upx + run: sudo apt install upx -y + + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.19 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..a5ced42 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,51 @@ +before: + hooks: + - go mod tidy + +builds: + - main: . + env: + - CGO_ENABLED=0 + goos: + - windows + goarch: + - amd64 + + ignore: + - goos: windows + goarch: 'arm64' + + binary: 'wxapkg' + + flags: + - '-trimpath' + ldflags: + - '-s -w' + - '-X main.version={{ .Version }}' + - '-X main.commit={{ .ShortCommit }}' + hooks: + post: "upx --lzma {{ .Path }}" + +changelog: + filters: + exclude: + - '^doc:' + - typo + - (?i)foo + - '^ref' + - '^style' + groups: + - title: Features + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: 'Bug fixes' + regexp: "^.*fix[(\\w)]*:+.*$" + order: 1 + - title: Others + order: 999 + +archives: + - format: binary + +checksum: + algorithm: md5 \ No newline at end of file