Skip to content

Commit d5ddf14

Browse files
authored
Merge pull request #33 from reviewdog/introduce-release-workflow
introduce release workflow
2 parents 1f1b31d + 55701e9 commit d5ddf14

File tree

5 files changed

+59
-4
lines changed

5 files changed

+59
-4
lines changed

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Clone repo
9-
uses: actions/checkout@master
9+
uses: actions/checkout@v3
1010
with:
1111
fetch-depth: 1
1212
- name: Build the Docker image

.github/workflows/pr-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: clone
9-
uses: actions/checkout@master
9+
uses: actions/checkout@v3
1010
- uses: ./
1111
with:
1212
github_token: ${{ secrets.github_token }}

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- 'v*.*.*'
8+
pull_request:
9+
types:
10+
- labeled
11+
12+
jobs:
13+
release:
14+
if: github.event.action != 'labeled'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
# Bump version on merging Pull Requests with specific labels.
20+
# (bump:major,bump:minor,bump:patch)
21+
- id: bumpr
22+
if: "!startsWith(github.ref, 'refs/tags/')"
23+
uses: haya14busa/action-bumpr@v1
24+
25+
# Update corresponding major and minor tag.
26+
# e.g. Update v1 and v1.2 when releasing v1.2.3
27+
- uses: haya14busa/action-update-semver@v1
28+
if: "!steps.bumpr.outputs.skip"
29+
with:
30+
tag: ${{ steps.bumpr.outputs.next_version }}
31+
32+
# Get tag name.
33+
- id: tag
34+
uses: haya14busa/action-cond@v1
35+
with:
36+
cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
37+
if_true: ${{ github.ref }}
38+
if_false: ${{ steps.bumpr.outputs.next_version }}
39+
40+
# Create release
41+
- if: "steps.tag.outputs.value != ''"
42+
env:
43+
TAG_NAME: ${{ steps.tag.outputs.value }}
44+
CURRENT: ${{ steps.bumpr.outputs.current_version }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
run: |
47+
gh release create "${TAG_NAME}" -t "Release ${TAG_NAME/refs\/tags\//}" --generate-notes --notes-start-tag "${CURRENT}"
48+
49+
release-check:
50+
if: github.event.action == 'labeled'
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v3
54+
- name: Post bumpr status comment
55+
uses: haya14busa/action-bumpr@v1

.github/workflows/reviewdog.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
cpplint:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@master
8+
- uses: actions/checkout@v3
99
- uses: reviewdog/action-cpplint@master
1010
with:
1111
github_token: ${{ secrets.github_token }}

.github/workflows/self-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: clone
9-
uses: actions/checkout@master
9+
uses: actions/checkout@v3
1010
with:
1111
fetch-depth: 2
1212
- name: testbuild

0 commit comments

Comments
 (0)