Skip to content

Commit 5d200ff

Browse files
committed
add publishing to pip
1 parent 070ed00 commit 5d200ff

File tree

4 files changed

+344
-1
lines changed

4 files changed

+344
-1
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ on:
3131
options:
3232
- true
3333
- false
34+
publish_pypi:
35+
description: "Publish to PyPI"
36+
required: true
37+
type: choice
38+
default: "false"
39+
options:
40+
- true
41+
- false
3442

3543
env:
3644
PIP_USE_PEP517: true
@@ -360,3 +368,24 @@ jobs:
360368
makeLatest: ${{github.event.inputs.is_latest == 'true'}}
361369
artifacts: "client.zip,wheels/*,pyinstaller/*,appimage/*"
362370
token: ${{ secrets.PAT }}
371+
372+
publish-pypi:
373+
name: Publish to PyPI
374+
runs-on: ubuntu-latest
375+
needs: [build-wheels]
376+
if: ${{ github.event.inputs.publish_pypi == 'true' }}
377+
permissions:
378+
id-token: write
379+
380+
steps:
381+
- name: Download wheel artifacts
382+
uses: actions/download-artifact@v4
383+
with:
384+
name: wheels
385+
path: dist
386+
merge-multiple: true
387+
388+
- name: Publish to PyPI
389+
uses: pypa/gh-action-pypi-publish@release/v1
390+
with:
391+
verbose: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ nohup.out
3939
*.egg-info
4040
/wheels/
4141
client.zip
42-
*.whl
42+
*.whl
43+
.pypirc

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,8 @@ Issues = "https://github.com/swingmx/swingmusic/issues"
6767
version_scheme = "only-version"
6868
local_scheme = "no-local-version"
6969
fallback_version = "v0.0.0"
70+
71+
[dependency-groups]
72+
dev = [
73+
"twine>=6.1.0",
74+
]

0 commit comments

Comments
 (0)