Skip to content

Commit 3b93425

Browse files
Merge a60a91b into a341aa7
2 parents a341aa7 + a60a91b commit 3b93425

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

.github/workflows/release.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: release
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
patch-release:
9+
name: Create Patch Release
10+
# [TODO] added merged check back once finished test
11+
# if: (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'patch') )
12+
if: contains(github.event.pull_request.labels.*.name, 'patch')
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Check out the `master` branch
16+
- uses: zendesk/checkout@v2
17+
# Compute the next semantic version
18+
- name: Compute release tag
19+
id: compute_tag
20+
uses: zendesk/compute-tag@v10
21+
with:
22+
github_token: ${{ github.token }}
23+
version_scheme: semantic
24+
version_type: patch
25+
# Create a new GitHub release
26+
- name: Create release
27+
id: create_release
28+
uses: zendesk/[email protected]
29+
with:
30+
tag_name: ${{ steps.compute_tag.outputs.next_tag }}
31+
release_name: ${{ steps.compute_tag.outputs.next_tag }}
32+
commitish: ${{ github.git_ref }}
33+
body: |
34+
See [changes since last release](https://github.com/${{ github.repository }}/compare/${{ steps.compute_tag.outputs.previous_tag }}..${{ steps.compute_tag.outputs.next_tag }}) for full release details.
35+
prerelease: false
36+
draft: false
37+
env:
38+
GITHUB_TOKEN: ${{ github.token }}
39+
minor-release:
40+
name: Create Minor Release
41+
runs-on: ubuntu-latest
42+
# only run this job on a merge to master and with the corresponding sem ver label
43+
if: (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'minor') )
44+
steps:
45+
# Check out the `master` branch
46+
- uses: zendesk/checkout@v2
47+
# Compute the next semantic version
48+
- name: Compute release tag
49+
id: compute_tag
50+
uses: zendesk/compute-tag@v10
51+
with:
52+
github_token: ${{ github.token }}
53+
version_scheme: semantic
54+
version_type: minor
55+
# Create a new GitHub release
56+
- name: Create release
57+
id: create_release
58+
uses: zendesk/[email protected]
59+
with:
60+
tag_name: ${{ steps.compute_tag.outputs.next_tag }}
61+
release_name: ${{ steps.compute_tag.outputs.next_tag }}
62+
commitish: ${{ github.git_ref }}
63+
body: |
64+
See [changes since last release](https://github.com/${{ github.repository }}/compare/${{ steps.compute_tag.outputs.previous_tag }}..${{ steps.compute_tag.outputs.next_tag }}) for full release details.
65+
prerelease: false
66+
draft: false
67+
env:
68+
GITHUB_TOKEN: ${{ github.token }}
69+
major-release:
70+
name: Create Major Release
71+
runs-on: ubuntu-latest
72+
# only run this job on a merge to master and with the corresponding sem ver label
73+
if: (github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'major') )
74+
steps:
75+
# Check out the `master` branch
76+
- uses: zendesk/checkout@v2
77+
# Compute the next semantic version
78+
- name: Compute release tag
79+
id: compute_tag
80+
uses: zendesk/compute-tag@v10
81+
with:
82+
github_token: ${{ github.token }}
83+
version_scheme: semantic
84+
version_type: major
85+
# Create a new GitHub release
86+
- name: Create release
87+
id: create_release
88+
uses: zendesk/[email protected]
89+
with:
90+
tag_name: ${{ steps.compute_tag.outputs.next_tag }}
91+
release_name: ${{ steps.compute_tag.outputs.next_tag }}
92+
commitish: ${{ github.git_ref }}
93+
body: |
94+
See [changes since last release](https://github.com/${{ github.repository }}/compare/${{ steps.compute_tag.outputs.previous_tag }}..${{ steps.compute_tag.outputs.next_tag }}) for full release details.
95+
prerelease: false
96+
draft: false
97+
env:
98+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)