Skip to content

Try new way of publishing #25

Try new way of publishing

Try new way of publishing #25

Workflow file for this run

name: Build and publish to PyPI
on:
push:
branches:
- "ci/use-trusted-publisher"
tags:
- "*"
jobs:
build_and_publish:
name: Build and publish
runs-on: ubuntu-latest
environment: testpypi
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Checkout πŸ”
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
- name: Set up Python 🐍
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 #v4.7.1
with:
python-version: "3.9"
- name: Install Poetry and pre-commit πŸ’ˆ
run: pip install poetry pre-commit
- name: Install dependencies πŸ› 
run: poetry install
# - name: Run pre-commit πŸ€”
# run: pre-commit run --all-files
#
# - name: Run tests 🌈
# run: poetry run invoke test
- name: Build the package πŸ“¦
run: poetry build
- name: Publish package to PyPI πŸ™Œ
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
# - name: Publish package to PyPI πŸ™Œ
# run: |
# set -e
# poetry config http-basic.pypi "__token__" "${PYPI_TOKEN}"
# poetry publish --build
# env:
# PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}