Skip to content

Commit

Permalink
feat(release): test release build on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
FalcoSuessgott committed Jan 16, 2024
1 parent 3516aa1 commit 4ea2d6d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
tags:
- '*'
pull_request:

permissions:
contents: write
Expand All @@ -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 }}
12 changes: 7 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -39,6 +34,13 @@ builds:
- '386'
- arm
- arm64
ignore:
- goos: openbsd
goarch: arm64
- goos: darwin
goarch: '386'
- goos: linux
goarch: amd64
archives:
-
builds:
Expand Down

0 comments on commit 4ea2d6d

Please sign in to comment.