Skip to content

Commit

Permalink
Run goreleaser on merge to main (#14)
Browse files Browse the repository at this point in the history
Make a release when every PR lands on main

Signed-off-by: Aidan Delaney <adelaney21@bloomberg.net>
  • Loading branch information
AidanDelaney authored Apr 20, 2023
1 parent e1c921c commit 9c96e67
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...
run: go test -coverprofile=coverage.out -v ./...
37 changes: 37 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/buildpacks/scafall

go 1.18
go 1.20

require (
github.com/AlecAivazis/survey/v2 v2.3.6
Expand Down

0 comments on commit 9c96e67

Please sign in to comment.