Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Commit 5466551

Browse files
authored
Add release workflow (#4)
1 parent a1531f3 commit 5466551

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/release.yml

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

0 commit comments

Comments
 (0)