From 9c96e67a6d76629ff203b27e9e9f84b1f1c55216 Mon Sep 17 00:00:00 2001 From: Aidan Delaney Date: Thu, 20 Apr 2023 14:27:02 +0200 Subject: [PATCH] Run goreleaser on merge to main (#14) Make a release when every PR lands on main Signed-off-by: Aidan Delaney --- .github/workflows/go.yml | 9 ++++---- .github/workflows/goreleaser.yml | 37 ++++++++++++++++++++++++++++++++ go.mod | 2 +- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/goreleaser.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index dd0ce3da..99450a57 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,10 +16,11 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.17 + go-version: 'stable' - - name: Build - run: go build -v ./... + - name: Get dependencies + run: | + go get -v -t -d ./... - name: Test - run: go test -v ./... \ No newline at end of file + run: go test -coverprofile=coverage.out -v ./... diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml new file mode 100644 index 00000000..f7c47f09 --- /dev/null +++ b/.github/workflows/goreleaser.yml @@ -0,0 +1,37 @@ +name: goreleaser + +on: + pull_request: + branches: + - main + types: [closed] + paths-ignore: + - '**.md' + - 'resources/**' + - 'CODEOWNERS' + - 'LICENSE' + +permissions: + contents: write + +jobs: + goreleaser: + if: ${{ github.event.pull_request.merged }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: 1.20 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v4 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/go.mod b/go.mod index 76b7b836..766d7aec 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/buildpacks/scafall -go 1.18 +go 1.20 require ( github.com/AlecAivazis/survey/v2 v2.3.6