Skip to content

Commit

Permalink
Try new way of publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
fbjorn committed Feb 6, 2024
1 parent 26ff78d commit bd757eb
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ 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
Expand All @@ -24,16 +30,23 @@ jobs:
- name: Install dependencies πŸ› 
run: poetry install

- name: Run pre-commit πŸ€”
run: pre-commit run --all-files
# - name: Run pre-commit πŸ€”
# run: pre-commit run --all-files
#
# - name: Run tests 🌈
# run: poetry run invoke test

- name: Run tests 🌈
- name: Build the package πŸ“¦
run: poetry run invoke test

- 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 }}
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 }}

0 comments on commit bd757eb

Please sign in to comment.