Skip to content

Build and publish Python 🐍 package 📦 to PyPI #32

Build and publish Python 🐍 package 📦 to PyPI

Build and publish Python 🐍 package 📦 to PyPI #32

Workflow file for this run

name: Build and publish Python 🐍 package 📦 to PyPI
on:
workflow_dispatch:
release:
types:
- published
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.12"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install build tool
run: pip install build
- name: Build package
run: python -m build
- name: Upload package as build artifact
uses: actions/upload-artifact@v4
with:
name: package
path: dist/
publish:
runs-on: ubuntu-latest
needs: build
environment:
name: pypi
url: https://pypi.org/p/rl4co
permissions:
id-token: write
steps:
- name: Collect packages to release
uses: actions/download-artifact@v4
with:
name: package
path: dist/
- name: Publish packages to PyPI
uses: pypa/gh-action-pypi-publish@release/v1