-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
94 lines (85 loc) · 2.75 KB
/
ci.yml
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
name: Continuous Integration
env:
GO_VERSION: 1.22
on:
push:
branches:
- automatic-release
pull_request:
jobs:
check-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Check for Blocking Issues/PRs
id: check_blocks
uses: actions/github-script@v6
with:
script: |
const { data: issues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: 'blocks-release',
state: 'open'
});
if (issues.length > 0) {
core.setOutput('block_release', 'true');
core.setOutput('blocking_items', issues.map(issue => `- ${issue.title} (#${issue.number})`).join("\n"));
} else {
core.setOutput('block_release', 'false');
}
- name: Stop if Blocks Exist
if: steps.check-blocks.outputs.block_release == 'true'
run: |
echo "Blocking issues/PRs detected:"
echo "${{ steps.check-blocks.outputs.blocking_items }}"
exit 1
- name: Get Latest Tag
id: get_latest_tag
run: |
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0")
echo "Latest tag: $latest_tag"
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
- name: Bump Version
id: bump_version
run: |
IFS='.' read -r major minor patch <<< "${{ env.latest_tag#v }}"
new_minor=$((minor + 1))
new_tag="v$major.$new_minor.0"
echo "New tag: $new_tag"
echo "new_tag=$new_tag" >> $GITHUB_ENV
- name: Generate Release Notes
id: generate_notes
uses: mikepenz/release-changelog-builder-action@v4
with:
configuration: |
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Features ✨
labels:
- feature
- title: Enhancements 🔥
labels:
- enhancement
- title: Fixes 🔧
labels:
- bug
- title: Maintenance ⚙️
labels:
- maintenance
- title: Docs 📖
labels:
- docs
- title: I18n 🌎
labels:
- i18n
- title: Performance Improvements 📊
labels:
- performance
- title: Other Changes
labels:
- "*"