diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26c5d47..a787d27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: tags: - '*' + pull_request: permissions: contents: write @@ -23,12 +24,24 @@ jobs: with: go-version: "1.16" - - + # if tag release + - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 + if: startsWith(github.ref, 'refs/tags/v') with: - distribution: goreleaser version: latest args: release --rm-dist env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # if no tag test release build + - + name: Run GoReleaser skip publishing + uses: goreleaser/goreleaser-action@v5 + if: "!startsWith(github.ref, 'refs/tags/v')" + with: + version: latest + args: release --skip=publish --skip=validate + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index d316720..ed91c5f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,11 +10,6 @@ builds: - id: plugin-check mod_timestamp: '{{ .CommitTimestamp }}' - hooks: - # This will check plugin compatibility against latest version of Packer - post: - - go install github.com/hashicorp/packer-plugin-sdk/cmd/packer-sdc@latest - - bash -ec 'cd "{{ dir .Path}}" && packer-sdc plugin-check {{ .Name }}' flags: - -trimpath ldflags: @@ -39,6 +34,13 @@ builds: - '386' - arm - arm64 + ignore: + - goos: openbsd + goarch: arm64 + - goos: darwin + goarch: '386' + - goos: linux + goarch: amd64 archives: - builds: