-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (87 loc) · 2.86 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Release Workflow
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-18.04
steps:
- uses: hmarr/debug-action@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install asdf
uses: asdf-vm/actions/setup@v1
- name: Cache tools
uses: actions/cache@v2
with:
path: /home/runner/.asdf
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}
- name: Install tools
run: |
while IFS= read -r line; do
tool=$(echo $line | cut -f 1 -d ' ')
vers=$(echo $line | cut -f 2 -d ' ')
asdf plugin-add $tool || true
asdf install $tool $vers
asdf plugin-update $tool
done <<< $(sed -nr '/git-chglog|semtag/p' .tool-versions)
asdf reshim
- name: Check PR labels
id: prLabels
uses: shioyang/check-pr-labels-on-push-action@v1.0.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
labels: '["release_candidate"]'
- name: Update Changelog
id: nextver
if: steps.prLabels.outputs.result == 'false'
run: |
make changelog_next
make bump_next_version
nextver=$(make bump_next_version)
echo "::set-output name=value::$nextver"
- name: Create Pull Request
if: steps.prLabels.outputs.result == 'false'
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
signoff: false
branch: chore/release
base: main
delete-branch: true
title: "chore(${{ steps.nextver.outputs.value }}): bump version and update changelog"
commit-message: "chore(${{ steps.nextver.outputs.value }}): bump version and update changelog"
body: |
- bump package version (${{ steps.nextver.outputs.value }})
- update changelog
labels: |
release_candidate
team-reviewers: |
owners
maintainers
draft: false
- name: Push Tag
if: steps.prLabels.outputs.result == 'true'
run: |
make release
- name: Get Version
id: lastver
if: steps.prLabels.outputs.result == 'true'
run: |
lastver=$(semtag getlast)
echo "::set-output name=value::$lastver"
- name: Release Tag
if: steps.prLabels.outputs.result == 'true'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GH_SECRET }}
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: '${{ steps.lastver.outputs.value }}',
name: '${{ steps.lastver.outputs.value }}',
})