Skip to content

Commit

Permalink
Merge pull request #66 from shipengqi/chore/release
Browse files Browse the repository at this point in the history
chore(release): add release workflow
  • Loading branch information
shipengqi authored May 8, 2024
2 parents 887ba58 + f01d67c commit dd77e5f
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
labels:
- "dependencies"
commit-message:
prefix: "feat"
prefix: "chore"
include: "scope"
- package-ecosystem: "github-actions"
assignees:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
jobs:
analyze:
name: analyze
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/gitleaks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
permissions:
contents: read
jobs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/grype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
jobs:
scan-source:
name: scan-source
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,20 @@ on:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
permissions:
contents: read

jobs:
golangci:
strategy:
matrix:
go: [ '1.20', '1.21' ]
go: [ '1.20', '1.21', '1.22' ]
os: [ ubuntu-latest, windows-latest ]
permissions:
contents: read # for actions/checkout to fetch code
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "release a version"
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # it is required fot the changelog to work correctly
- uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
with:
distribution: goreleaser
version: latest
args: release --debug --clean

2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yaml'
jobs:
unit-test:
runs-on: ubuntu-latest
Expand Down
35 changes: 35 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
builds:
- # If true, skip the build.
# Useful for library projects.
skip: true
changelog:
sort: asc
use: github
filters:
exclude:
- '^Merge'
groups:
- title: 'New Features'
regexp: "^.*feat.*:+.*$"
order: 100
- title: 'Bug Fixes'
regexp: "^.*fix.*:+.*$"
order: 200
- title: 'Dependency Updates'
regexp: "^.*(feat|fix)\\(deps\\)*:+.*$"
order: 300
- title: 'Documentation Updates'
regexp: "^.*docs.*:+.*$"
order: 400
- title: Other work
order: 9999
release:
footer: |
**Full Changelog**: https://github.com/shipengqi/golib/compare/{{ .PreviousTag }}...{{ .Tag }}
# modelines, feel free to remove those if you don't want/use them:
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

0 comments on commit dd77e5f

Please sign in to comment.