Skip to content

Commit 11eb66e

Browse files
committed
Update release.yml
1 parent b3190dd commit 11eb66e

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

.github/workflows/release.yml

+19-20
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,21 @@ on:
77
- main
88

99
jobs:
10-
update-changelog:
10+
release:
11+
name: "Generate release and publish to PyPI"
1112
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
1218
steps:
13-
- name: Checkout code
19+
- name: Checkout repository
1420
uses: actions/checkout@v4
1521
with:
16-
ref: main
22+
fetch-depth: 0
23+
token: ${{ secrets.KILOBYTE_BOT_PAT }}
24+
fetch-tags: true
1725

1826
- name: Update Changelog
1927
uses: stefanzweifel/changelog-updater-action@v1
@@ -28,45 +36,36 @@ jobs:
2836
commit_message: Update CHANGELOG
2937
file_pattern: CHANGELOG.md
3038

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
4639
- name: Set up Python
4740
uses: actions/setup-python@v5
4841
with:
4942
python-version: "3.10"
43+
5044
- name: Install dependencies
5145
run: |
5246
python -m pip install --upgrade pip
5347
pip install -r requirements-dev.txt
48+
5449
- name: Git Config
5550
run: |
5651
git config --global user.email "[email protected]"
5752
git config --global user.name "kilobyte-bot"
53+
5854
- name: Update __version__ in __init__.py
5955
run: |
56+
git pull origin HEAD:main
6057
echo "Version: ${{ github.ref_name }}"
6158
sed -i "s/__version__ = .*/__version__ = '${{ github.ref_name }}'/" ./tunsberg/__init__.py
6259
cat ./tunsberg/__init__.py
6360
git commit -am "Bump version to ${{ github.ref_name }}"
6461
git push origin HEAD:main
62+
6563
- name: Build package
66-
run: |
67-
python setup.py bdist_wheel
64+
run: python setup.py bdist_wheel
65+
6866
- name: Publish package distributions to PyPI
6967
uses: pypa/gh-action-pypi-publish@release/v1
68+
7069
- name: Post release to Discord
7170
uses: SethCohen/[email protected]
7271
with:

0 commit comments

Comments
 (0)