Skip to content

Commit

Permalink
Merge pull request #21 from k1LoW/tagpr
Browse files Browse the repository at this point in the history
Setup tagpr
  • Loading branch information
k1LoW committed Apr 1, 2024
2 parents 564a25c + 8433c1b commit d306b32
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
achangelog:
exclude:
labels:
- tagpr
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: New Features 🎉
labels:
- enhancement
- title: Fix bug 🐛
labels:
- bug
- title: Other Changes
labels:
- "*"
23 changes: 23 additions & 0 deletions .github/workflows/tagpr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: tagpr
on:
push:
branches:
- main

jobs:
tagpr:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Check out source code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod

- id: run-tagpr
name: Run tagpr
uses: Songmu/tagpr@v1
36 changes: 36 additions & 0 deletions .tagpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# config file for the tagpr in git config format
# The tagpr generates the initial configuration, which you can rewrite to suit your environment.
# CONFIGURATIONS:
# tagpr.releaseBranch
# Generally, it is "main." It is the branch for releases. The pcpr tracks this branch,
# creates or updates a pull request as a release candidate, or tags when they are merged.
#
# tagpr.versionFile
# Versioning file containing the semantic version needed to be updated at release.
# It will be synchronized with the "git tag".
# Often this is a meta-information file such as gemspec, setup.cfg, package.json, etc.
# Sometimes the source code file, such as version.go or Bar.pm, is used.
# If you do not want to use versioning files but only git tags, specify the "-" string here.
# You can specify multiple version files by comma separated strings.
#
# tagpr.vPrefix
# Flag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true)
# This is only a tagging convention, not how it is described in the version file.
#
# tagpr.changelog (Optional)
# Flag whether or not changelog is added or changed during the release.
#
# tagpr.command (Optional)
# Command to change files just before release.
#
# tagpr.tmplate (Optional)
# Pull request template in go template format
#
# tagpr.release (Optional)
# GitHub Release creation behavior after tagging [true, draft, false]
# If this value is not set, the release is to be created.
[tagpr]
vPrefix = true
releaseBranch = main
versionFile = -
command = "make prerelease_for_tagpr"
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ lint:
depsdev:
go install github.com/Songmu/ghch/cmd/ghch@latest
go install github.com/Songmu/gocredits/cmd/gocredits@latest
go install github.com/securego/gosec/v2/cmd/gosec@latest

prerelease:
git pull origin main --tag
Expand All @@ -25,6 +24,11 @@ prerelease:
git commit -m'Bump up version number'
git tag ${VER}

prerelease_for_tagpr: depsdev
gocredits -w .
cat _EXTRA_CREDITS >> CREDITS
git add CHANGELOG.md CREDITS go.mod go.sum

release:
git push origin main --tag

Expand Down

0 comments on commit d306b32

Please sign in to comment.