Skip to content

Commit

Permalink
Use trusted publisher
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Apr 26, 2023
1 parent ded82e7 commit 37d7687
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 23 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: check
on:
push:
tags-ignore: ["**"]
pull_request:
schedule:
- cron: "0 8 * * *"
Expand Down Expand Up @@ -135,26 +136,3 @@ jobs:
run: tox -vv --notest -e ${{ matrix.tox_env }}
- name: Run test suite
run: tox --skip-pkg-install -e ${{ matrix.tox_env }}

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [check, coverage]
runs-on: ubuntu-latest
steps:
- name: Setup python to build package
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install build
run: python -m pip install build
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build sdist and wheel
run: python -m build -s -w . -o dist
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@v1.8.5
with:
skip_existing: true
user: __token__
password: ${{ secrets.pypi_password }}
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release to PyPI
on:
push:
tags: ["*"]

jobs:
release:
runs-on: ubuntu-22.04
environment:
name: release
url: https://pypi.org/p/platformdirs
permissions:
id-token: write
steps:
- name: Setup python to build package
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install build
run: python -m pip install build
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build package
run: pyproject-build -s -w . -o dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.5

0 comments on commit 37d7687

Please sign in to comment.