Skip to content

Commit

Permalink
misc: pypi workflow update (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
myungjin authored Jun 10, 2024
1 parent c7c440e commit 172b715
Showing 1 changed file with 43 additions and 22 deletions.
65 changes: 43 additions & 22 deletions .github/workflows/pypi_release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
name: Publish to PyPi
name: Publish MultiWorld to PyPi

on:
release:
types: [published]

jobs:
publish:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- name: Check out the code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install build dependencies
run: pip install build

- name: Build the package
run: python -m build

- name: Publish to PyPI
env:
TWINE_API_KEY: ${{ secrets.PYPI_API_KEY }}
run: |
pip install twine
twine upload --skip-existing dist/*
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish MultiWorld distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/multiworld
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 172b715

Please sign in to comment.