Skip to content

Commit

Permalink
ci: Use trusted publisher (#174)
Browse files Browse the repository at this point in the history
* Use trusted publisher

* Remove use of poetry

* Rename steps
  • Loading branch information
daniel-mills-cqc authored Nov 29, 2024
1 parent db8fcbb commit 2177985
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:

run-tests:
name: Build and test
name: Run tests
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
Expand All @@ -29,8 +29,8 @@ jobs:
cd tests
pytest --cov-report term-missing:skip-covered --cov=qermit --durations=10
publish:
name: Test publication
build-distribution:
name: Build distribution
runs-on: ubuntu-latest

steps:
Expand All @@ -46,8 +46,14 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Publish Qermit Dry Run
run: poetry publish -u __token__ -p ${{ secrets.PYPI_RELEASE_TOKEN }} --build --skip-existing --dry-run
- name: Build Qermit
run: poetry build

- name: Save build
uses: actions/upload-artifact@v4
with:
name: build
path: dist

build-docs:
name: Test documentation build
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ concurrency:

jobs:
Release:
name: Build and release
runs-on: ubuntu-latest

permissions:
id-token: write

steps:

Expand All @@ -27,6 +31,9 @@ jobs:

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Build Qermit
run: poetry build

- name: Publish Qermit
run: poetry publish -u __token__ -p ${{ secrets.PYPI_RELEASE_TOKEN }} --build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit 2177985

Please sign in to comment.