GitHub Action for GoReleaser
___  * [Usage](#usage) * [Workflow](#workflow) * [Run on new tag](#run-on-new-tag) * [Signing](#signing) * [Customizing](#customizing) * [inputs](#inputs) * [environment variables](#environment-variables) * [Limitation](#limitation) * [License](#license) ## Usage ### Workflow ```yaml name: goreleaser on: pull_request: push: jobs: goreleaser: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Unshallow run: git fetch --prune --unshallow - name: Set up Go uses: actions/setup-go@v2 with: go-version: 1.14 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: version: latest args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` > **IMPORTANT**: note the `Unshallow` step. It is required for the changelog to work correctly. ### Run on new tag If you want to run GoReleaser only on new tag, you can use this event: ```yaml on: push: tags: - '*' ``` Or with a condition on GoReleaser step: ```yaml - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 if: startsWith(github.ref, 'refs/tags/') with: version: latest args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` > For detailed instructions please follow GitHub Actions [workflow syntax](https://help.github.com/en/articles/workflow-syntax-for-github-actions#About-yaml-syntax-for-workflows). ### Signing If [signing is enabled](https://goreleaser.com/customization/#Signing) in your GoReleaser configuration, you can use the [Import GPG](https://github.com/crazy-max/ghaction-import-gpg) GitHub Action along with this one: ```yaml - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v1 env: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} PASSPHRASE: ${{ secrets.PASSPHRASE }} - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: version: latest args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` And reference the userID in your signing configuration: ```yaml signs: - artifacts: checksum args: ["--batch", "-u", "