Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 63 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,77 @@ on:
types: [created]

jobs:
release:
build:
name: Build Python distribution
runs-on: ubuntu-24.04

permissions:
contents: read
steps:
- name: Checkout source code
uses: actions/checkout@v6
with:
persist-credentials: false

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.10"

- name: Pip install
- name: Install Poetry
run: python -m pip install --upgrade pip poetry
shell: bash

- name: Checkout source code
uses: actions/checkout@v4
- name: Build distribution
run: poetry build

- name: Upload distribution artifact
uses: actions/upload-artifact@v4
with:
name: python-distributions
path: dist/

publish-to-pypi:
name: Publish Python distribution to PyPI
needs: build
runs-on: ubuntu-24.04

- run: poetry publish --build
env:
POETRY_PYPI_TOKEN_PYPI: ${{secrets.POETRY_PYPI_TOKEN_PYPI}}
environment:
name: pypi
url: https://pypi.org/p/ubi-reader

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download distribution artifact
uses: actions/download-artifact@v5
with:
name: python-distributions
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

publish-to-testpypi:
name: Publish Python distribution to TestPyPi
needs: build
runs-on: ubuntu-24.04

environment:
name: testpypi
url: https://test.pypi.org/p/ubi-reader

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download distribution artifact
uses: actions/download-artifact@v5
with:
name: python-distributions
path: dist/

- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
Loading