7
7
- main
8
8
9
9
jobs :
10
- update-changelog :
10
+ release :
11
+ name : " Generate release and publish to PyPI"
11
12
runs-on : ubuntu-latest
13
+ environment :
14
+ name : pypi
15
+ url : https://pypi.org/p/tunsberg
16
+ permissions :
17
+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
12
18
steps :
13
- - name : Checkout code
19
+ - name : Checkout repository
14
20
uses : actions/checkout@v4
15
21
with :
16
- ref : main
22
+ fetch-depth : 0
23
+ token : ${{ secrets.KILOBYTE_BOT_PAT }}
24
+ fetch-tags : true
17
25
18
26
- name : Update Changelog
19
27
uses : stefanzweifel/changelog-updater-action@v1
@@ -28,45 +36,36 @@ jobs:
28
36
commit_message : Update CHANGELOG
29
37
file_pattern : CHANGELOG.md
30
38
31
- pypi-publish :
32
- name : Upload release to PyPI
33
- runs-on : ubuntu-latest
34
- environment :
35
- name : pypi
36
- url : https://pypi.org/p/tunsberg
37
- permissions :
38
- id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
39
- steps :
40
- - name : Checkout repository
41
- uses : actions/checkout@v4
42
- with :
43
- fetch-depth : 0
44
- token : ${{ secrets.KILOBYTE_BOT_PAT }}
45
- fetch-tags : true
46
39
- name : Set up Python
47
40
uses : actions/setup-python@v5
48
41
with :
49
42
python-version : " 3.10"
43
+
50
44
- name : Install dependencies
51
45
run : |
52
46
python -m pip install --upgrade pip
53
47
pip install -r requirements-dev.txt
48
+
54
49
- name : Git Config
55
50
run : |
56
51
git config --global user.email "[email protected] "
57
52
git config --global user.name "kilobyte-bot"
53
+
58
54
- name : Update __version__ in __init__.py
59
55
run : |
56
+ git pull origin HEAD:main
60
57
echo "Version: ${{ github.ref_name }}"
61
58
sed -i "s/__version__ = .*/__version__ = '${{ github.ref_name }}'/" ./tunsberg/__init__.py
62
59
cat ./tunsberg/__init__.py
63
60
git commit -am "Bump version to ${{ github.ref_name }}"
64
61
git push origin HEAD:main
62
+
65
63
- name : Build package
66
- run : |
67
- python setup.py bdist_wheel
64
+ run : python setup.py bdist_wheel
65
+
68
66
- name : Publish package distributions to PyPI
69
67
uses : pypa/gh-action-pypi-publish@release/v1
68
+
70
69
- name : Post release to Discord
71
70
72
71
with :
0 commit comments