Skip to content

release

release #6

Workflow file for this run

# This workflow will publish a python package on pypi, when a release is created
name: release
on:
release:
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install poetry poetry-dynamic-versioning
- name: Build package
run: |
poetry build
- name: Archive the dist folder
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
retention-days: 1
publish:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
id-token: write
steps:
- name: Download the dist folder from the build job
uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Upload binaries to release
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/*
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
################################
# REMOVE CUSTOM REPOSITORY TO #
# PUBLISH ON OFFICIAL PYPI #
################################
with:
repository-url: https://test.pypi.org/legacy/