Skip to content

Commit

Permalink
fix: publish to pypi
Browse files Browse the repository at this point in the history
Signed-off-by: loonghao <[email protected]>
  • Loading branch information
loonghao committed May 4, 2024
1 parent 41ef17c commit fe2b2ad
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/mr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: MR Checks
on: [pull_request]

jobs:
python-check:
runs-on: windows-2022
strategy:
max-parallel: 3
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -U pip poetry nox
poetry --version
nox --version
nox -s preflight
15 changes: 9 additions & 6 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
Expand All @@ -26,12 +29,12 @@ jobs:
python -m pip install -U pip poetry nox
poetry --version
poetry install
- name: Publish
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry publish --build -u $PYPI_USERNAME -p $PYPI_PASSWORD
# Note that we don't need credentials.
# We rely on https://docs.pypi.org/trusted-publishers/.
- name: Upload to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
- name: Create release Version
run: gh release create ${{ steps.vars.outputs.tag }} --generate-notes
env:
Expand Down

0 comments on commit fe2b2ad

Please sign in to comment.