• Stars
    star
    144
  • Rank 248,312 (Top 6 %)
  • Language
    Go
  • License
    MIT License
  • Created almost 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

automatically creates and updates a pull request for unreleased items, tag them when they are merged, and create releases.

tagpr

Test Status MIT License PkgGoDev

The tagpr clarify the release flow. It automatically creates and updates a pull request for unreleased items, tag them when they are merged, and create releases.

Synopsis

The tagpr is designed to run on github actions.

# .github/workflows/tagpr.yml
name: tagpr
on:
  push:
    branches: ["main"]
jobs:
  tagpr:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: Songmu/tagpr@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

If you do not want to use the token provided by GitHub Actions, do the following This is useful if you want to trigger another action with a tag.

ref. https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow

For simplicity, we include an example of specifying a personal access token here. However, issuing the temporary token in conjunction with the GitHub App would be safer than a personal access token.

name: tagpr
on:
  push:
    branches:
    - main
jobs:
  tagpr:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      with:
        token: ${{ secrets.GH_PAT }}
    - uses: Songmu/tagpr@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GH_PAT }}

Description

By using tagpr, the release flow can be made easier and more apparent because it can be put into a flow where the release is completed by pressing the merge button on a pull request that is automatically created.

If there are differences between the last release and the main branch, tagpr generates a pull request for the next release. The tagpr considers a semver tagged commit as a release. It would be standard practice.

You can leave this pull request until you want to make the next release; each time the main branch is updated, this pull request will automatically follow it.

When this pull request is merged, the merge commit is automatically tagged, and GitHub Releases are created simultaneously.

As mentioned at the beginning of this section, the release process becomes simply a matter of pressing the merge button.

In addition, release items will be made into pull requests, allowing for visualization and review of necessary changes at the time of release. This is also important to prevent accidents.

Versioning Rules

How tagpr proposes the next version number and how to adjust it.

How to determine the next version number of candidate

When creating a pull request by tagpr, the next version number candidate is determined in the following way.

  • Conventional Labels: If the merged pull requests for the next release have labels named "major" or "minor," the version is determined accordingly (of course, major has priority).
  • If no conventional labels are found, the patch version is incremented.

How to adjust the next version by yourself

You can adjust the next version number suggested by tagpr directly on the pull request created by tagpr.

There are two ways to do it.

Version file

Edit and commit the version file specified in the .tagpr configuration file to describe the next version

Conventional labels

Add labels to the pull request like "tagpr:minor" or "tagpr:major." It is helpful to use a flow that does not use version files.

If there is a discrepancy between the version file and the conventional labels at the time of merging, the specification in the version file takes precedence.

Configuration

Describe the settings in the .tagpr file directly under the repository in gitconfig format. This is automatically created the first time tagpr is run, but feel free to adjust it. The following configuration items are available

tagpr.releaseBranch

Generally, it is "main." It is the branch for releases. The tagpr 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.template (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.majorLabels (Optional)

Label of major update targets. Default is [major]

tagpr.minorLabels (Optional)

Label of minor update targets. Default is [minor]

Outputs for GitHub Actions

The tagpr produces output to be used in conjunction with subsequent GitHub Actions jobs.

  • pull_request: Information of the pull request created by tagpr in JSON format
  • tag: Tag strings are output only if the tagpr has tagged

It is useful to see if tag is available and to run tasks after release. The following is an example of running action-update-semver after release.

- uses: actions/checkout@v3
- id: tagpr
  uses: Songmu/tagpr@v1
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: haya14busa/action-update-semver@v1
  if: "steps.tagpr.outputs.tag != ''"
  with:
    tag: ${{ steps.tagpr.outputs.tag }}

Author

Songmu

More Repositories

1

ghq-handbook

272
star
2

ghch

Generate changelog from git history, tags and merged pull requests
Go
204
star
3

horenso

Command wrapper for reporting the result. It is useful for cron jobs.
Go
151
star
4

prompter

golang utility for easy prompting
Go
143
star
5

ecschedule

ecschedule is a tool to manage ECS Scheduled Tasks.
Go
121
star
6

gocredits

creates CREDITS file from LICENSE files of dependencies
Go
95
star
7

ghg

Get the executable from github releases easily
Go
88
star
8

goxz

Just do cross building and archiving go tools conventionally
Go
84
star
9

timeout

Timeout invocation. Go porting of GNU timeout and able to use as Go package
Go
73
star
10

make2help

Utility for self-documented Makefile
Go
63
star
11

gotesplit

Splits the testing in Go into a subset and run it. It is useful for the CI environment.
Go
58
star
12

flextime

flextime improves time testability by replacing the backend clock flexibly.
Go
49
star
13

kibelasync

kibela client
Go
39
star
14

retry

Go
32
star
15

axslogparser

Fairly accurate access Log Parser
Go
27
star
16

peep

Watch a process and execute specified command for notification when finished
Go
27
star
17

godzil

A Go Authoring tool
Go
25
star
18

p5-Riji

git based simple static site generator mainly for blogging
Perl
25
star
19

go-httpdate

Well parsing and dealing the various date formats automatically
Go
22
star
20

maltmill

create and update Homebrew thrid party Formulae
Go
20
star
21

html-shakan

HTML::Shakan is a yet another form generator
Perl
18
star
22

goshim

Better `go run`. Build go codes transparently and exec
Go
16
star
23

crontabparser

utility to validate crontab and to create your own crond
Go
16
star
24

smartcache

Go
15
star
25

go-ltsv

Go
15
star
26

replaceablewriter

Go
12
star
27

strrand

Go
12
star
28

dotfiles

dotfiles
Vim Script
12
star
29

go-memcached-tool

go porting from memcached-tool in Perl (only support display and dump mode)
Go
10
star
30

timestamper

text transformer to put timestamps. It is very useful for logging.
Go
10
star
31

gh2changelog

Go
9
star
32

deglacer

Go
9
star
33

Yapafi

Yet Anather PHP Application Framework Interface
PHP
8
star
34

App-LJ

Perl
8
star
35

qnap-mackerel-agent

mackerel-agent installer for QNAP
Go
7
star
36

enslaver

Go
7
star
37

num

Go
7
star
38

wrapcommander

Go
6
star
39

gitconfig

Go
5
star
40

jfill

Assemble command using JSON via STDIN and execute it
Go
5
star
41

p5-L

perl module loader for oneliner
Perl
5
star
42

p5-Mackerel-Webhook-Receiver

Perl
5
star
43

postailer

Utility for reading files to start reading from the position read last time and also care file rotation
Go
5
star
44

p5-Text-Markdown-GitHubAPI

Perl
4
star
45

p5-Const-Common

Perl
4
star
46

Github-Hooks-Receiver

Perl
4
star
47

Puncheur

Perl
4
star
48

p5-Plack-App-Directory-Markdown

Perl
4
star
49

p5-DBIx-FixtureLoader

Perl
4
star
50

JapaneseZipCodeData-AutoDownloadAndExtract

Perl
3
star
51

GitDDL-Migrator

Perl
3
star
52

p5-HTTP-MobileAgent-Plugin-SmartPhone

Perl
3
star
53

action-shodo-lint

Shell
2
star
54

p5-MySQL-Warmer

Perl
2
star
55

homebrew-tap

Ruby
2
star
56

p5-Module-Setup-Flavor-ArkDBIC

Perl
2
star
57

App-tmclean

Perl
2
star
58

p5-App-CPANGhq

Perl
2
star
59

diet-wiki

JavaScript
2
star
60

p5-Redis-LeaderBoard

Perl
2
star
61

p5-Teng-Plugin-SearchJoined

Perl
2
star
62

mackerel-plugin-httpstat

Go
2
star
63

HTML-HTML5Forms

FormBuilder for HTML5
Perl
1
star
64

p5-Kannuki

Management htpasswd file
Perl
1
star
65

Math-CheckDigits

Perl Module to generate and test check digits
Perl
1
star
66

p5-Plack-Middleware-Auth-QueryString

Perl
1
star
67

p5-Plack-Middleware-HubSignature

Perl
1
star
68

p5-Encode-JP-Mobile-UnicodeEmoji

Perl
1
star
69

songmu_css_base

1
star
70

App-KV2JSON

Perl
1
star
71

Git-Repository-FileHistory

Perl
1
star
72

HyCycjk

Haiyou yige CGI yingyong chengxu jiemian kuangjia
Perl
1
star
73

p5-GitMasterData

Perl
1
star
74

p5-Cache-Redis

Perl
1
star
75

p5-DBIx-CSVDumper

Perl
1
star
76

gitsemvers

Go
1
star
77

p5-Parse-CommandLine

Perl
1
star
78

swimmy

Go
1
star
79

slack2slack

Go
1
star
80

p5-Const-Common-Generator

Perl
1
star
81

Github-Hooks-Manager

Perl
1
star
82

Text-KuaiWiki

Wiki Formatter used on KuaiWiki
Perl
1
star
83

p5-Config-PL

Perl
1
star
84

p5-App-StatusBin

Perl
1
star
85

p5-Math-RandomTable

Perl
1
star
86

p5-Data-GoogleSpreadsheet-Fetcher

Perl
1
star
87

ansible-roles-mackerel-agent

Python
1
star
88

p5-Test-mysqld-DatadirDumper

Perl
1
star
89

p5-SWF-Changer

Perl
1
star
90

p5-WinPB

Perl
1
star
91

git-rss

Go
1
star
92

ark-jobeet-2011

Perl
1
star
93

p5-App-RunCron

Perl
1
star
94

mkrp

Go
1
star
95

p5-blockdiagServer

Perl
1
star