diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..af9c6fc --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: release + +on: + push: + # Only create artifacts when there is a semantic-versioned release on GitHub (ex: v1.0.1) + tags: + - 'v*' + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16.x + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + distribution: goreleaser + version: latest + args: release --rm-dist -f .goreleaser.yml + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..1ac0a27 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,20 @@ +# 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 +builds: + # Custom environment variables to be set during the builds. + - env: + - CGO_ENABLED=0 + # For more info refer to: https://golang.org/doc/install/source#environment + goos: + - windows + goarch: + - amd64 +archives: + # Optionally override the matrix generation and specify only the final list of targets. + - format: binary + name_template: "{{ tolower .ProjectName }}" +checksum: + name_template: "checksums.txt"