Skip to content

Commit

Permalink
split release and build
Browse files Browse the repository at this point in the history
  • Loading branch information
kmulvey committed Apr 4, 2024
1 parent 368fdc1 commit 96f459e
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: concurrenthash
name: Build

on: push

Expand Down Expand Up @@ -42,33 +42,3 @@ jobs:

- name: Govulncheck
uses: kmulvey/govulncheck-action@v1.2.0

release:
name: concurrenthash release
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/

- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
cache: true
go-version: "1.22"

- name: changelog
run: |
go install -v github.com/goreleaser/chglog/cmd/chglog@latest
chglog format --template repo > CHANGELOG.md
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config .goreleaser.yaml --clean
env:
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release

on:
pull_request:
push:
# run only against tags
tags:
- "*"
jobs:
release:
name: concurrenthash release
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0 # See: https://goreleaser.com/ci/actions/

- name: Set up Go
uses: actions/setup-go@v5
with:
check-latest: true
cache: true
go-version: "1.22"

- name: changelog
run: |
go install -v github.com/goreleaser/chglog/cmd/chglog@latest
chglog format --template repo > CHANGELOG.md
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --config .goreleaser.yaml --clean
env:
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ release:
github:
owner: kmulvey
name: concurrenthash
# IDs of the archives to use.
ids:
- concurrenthash
# Whether to remove existing draft releases with the same name before creating
Expand All @@ -45,7 +44,7 @@ checksum:
name_template: "checksums.txt"

snapshot:
name_template: "{{ incpatch .Version }}-next"
name_template: "{{ incpatch .Version }}-snapshot"

changelog:
sort: asc
Expand Down

0 comments on commit 96f459e

Please sign in to comment.