Skip to content

Commit 63c3408

Browse files
committed
Updated labeler, release-drafter & publish workflow
1 parent 16e8655 commit 63c3408

File tree

3 files changed

+111
-30
lines changed

3 files changed

+111
-30
lines changed

.github/labeler.yml

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,54 @@
11
documentation:
2-
- "**/*.md"
3-
- LICENSE
4-
- "docs/**/*"
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- "**/*.md"
5+
- LICENSE
6+
- "docs/**/*"
57

68
dependencies:
7-
- requirements.txt
9+
- changed-files:
10+
- any-glob-to-any-file:
11+
- requirements.txt
12+
- requirements-dev.txt
813

9-
enhancement:
10-
- "**"
14+
publishing:
15+
- changed-files:
16+
- any-glob-to-any-file:
17+
- check_version.py
18+
- setup.py
19+
- MANIFEST.in
20+
- setup.cfg
1121

1222
github-actions:
13-
- ".github/**/*"
23+
- changed-files:
24+
- any-glob-to-any-file:
25+
- ".github/**/*"
1426

1527
tests:
16-
- "appointment/tests/**/*"
28+
- changed-files:
29+
- any-glob-to-any-file:
30+
- "appointment/tests/**/*"
1731

1832
user-interface:
19-
- "appointment/templates/**/*"
20-
- "appointment/static/**/*"
33+
- changed-files:
34+
- any-glob-to-any-file:
35+
- "appointment/templates/**/*"
36+
- "appointment/static/**/*"
37+
38+
feature:
39+
- head-branch: [ '^feature', 'feature' ]
40+
41+
bug:
42+
- head-branch: [ '^bug', 'bug' ]
43+
44+
fix:
45+
- head-branch: [ '^fix', 'fix' ]
46+
47+
bugfix:
48+
- head-branch: [ '^bugfix', 'bugfix' ]
49+
50+
chore:
51+
- head-branch: [ '^chore', 'chore' ]
52+
53+
maintenance:
54+
- head-branch: [ '^maintenance', 'maintenance' ]

.github/release-drafter.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,66 @@
1-
name-template: 'Release v${{NEXT_VERSION}}'
2-
tag-template: 'v${{NEXT_VERSION}}'
1+
name-template: 'Release v${{ env.RELEASE_VERSION }}'
2+
tag-template: 'v${{ env.RELEASE_VERSION }}'
33
categories:
44
- title: '🚀 Features'
55
labels:
66
- 'feature'
7-
- 'enhancement'
7+
collapse-after: 3
88
- title: '🐛 Bug Fixes'
99
labels:
1010
- 'fix'
1111
- 'bugfix'
1212
- 'bug'
13+
collapse-after: 3
1314
- title: '🧰 Maintenance'
1415
labels:
1516
- 'chore'
1617
- 'maintenance'
17-
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
18-
change-title-escapes: '\<*_&'
19-
version-resolver:
20-
major:
18+
collapse-after: 3
19+
- title: '🔨 Refactor'
2120
labels:
22-
- 'major'
23-
minor:
21+
- 'refactor'
22+
- 'refactoring'
23+
collapse-after: 3
24+
- title: '🧪 Testing'
2425
labels:
25-
- 'minor'
26-
patch:
26+
- 'tests'
27+
- 'testing'
28+
- 'test'
29+
- 'unittest'
30+
- 'pytest'
31+
collapse-after: 3
32+
- title: '📚 Documentation'
2733
labels:
28-
- 'patch'
29-
default: patch
30-
template: |
31-
## Changes
34+
- 'docs'
35+
- 'documentation'
36+
collapse-after: 3
37+
- title: '🔒 Security'
38+
labels:
39+
- 'security'
40+
- 'vulnerability'
41+
- 'vulnerabilities'
42+
- 'security-fix'
43+
- 'security-fixes'
44+
- 'security-update'
45+
- 'security-updates'
46+
- 'security-patch'
47+
- 'security-patches'
48+
- 'security-release'
49+
- 'security-releases'
50+
- 'security-issue'
51+
- 'security-issues'
52+
- 'security-bug'
53+
- 'security-bugs'
54+
- 'security-vulnerability'
55+
- 'security-vulnerabilities'
56+
- 'security-notice'
57+
- 'security-notices'
58+
collapse-after: 3
59+
- title: 'Enhancement'
60+
collapse-after: 3
61+
change-template: '- $TITLE by @$AUTHOR in (#$NUMBER)'
62+
change-title-escapes: '\<*_&'
3263

64+
template: |
65+
## What’s Changed
3366
$CHANGES

.github/workflows/publish.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
python setup.py sdist bdist_wheel
5959
6060
- name: Upload distribution packages as artifacts
61-
uses: actions/upload-artifact@v3
61+
uses: actions/upload-artifact@v4
6262
with:
6363
name: python-package-distributions
6464
path: dist/*
@@ -78,9 +78,13 @@ jobs:
7878
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
7979

8080
create-release:
81-
needs: build-and-publish
82-
if: needs.build-and-publish.outputs.publish_to_pypi == 'true'
81+
needs: [prepare-and-check, build-and-publish]
82+
if: needs.prepare-and-check.outputs.publish_to_pypi == 'true'
8383
runs-on: ubuntu-latest
84+
permissions:
85+
id-token: write
86+
contents: write
87+
8488
steps:
8589
- uses: actions/checkout@v4
8690

@@ -95,19 +99,29 @@ jobs:
9599
with:
96100
inputs: ./dist/*.tar.gz ./dist/*.whl
97101

102+
- name: Set Release Version Env
103+
run: echo "RELEASE_VERSION=${{ needs.prepare-and-check.outputs.version }}" >> $GITHUB_ENV
104+
98105
- name: Draft Release
99106
id: draft_release
100107
uses: release-drafter/release-drafter@v6
108+
with:
109+
commitish: main
110+
tag: v${{ env.RELEASE_VERSION }}
111+
name: Release ${{ env.RELEASE_VERSION }}
112+
version: ${{ env.RELEASE_VERSION }}
101113
env:
102114
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115+
RELEASE_VERSION: ${{ needs.prepare-and-check.outputs.version }}
103116

104117
- name: Create GitHub Release
105118
uses: actions/create-release@v1
106119
env:
107120
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121+
RELEASE_VERSION: ${{ needs.prepare-and-check.outputs.version }}
108122
with:
109-
tag_name: v${{ needs.prepare-and-check.outputs.version }}
110-
release_name: Release v${{ needs.prepare-and-check.outputs.version }}
123+
tag_name: v${{ env.RELEASE_VERSION }}
124+
release_name: Release ${{ env.RELEASE_VERSION }}
111125
body: ${{ steps.draft_release.outputs.body }}
112126
draft: false
113127
prerelease: false

0 commit comments

Comments
 (0)