Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish packages to PyPi with trusted publishers #151

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,33 @@ on:
types: [created]

jobs:
Publish:
publish:
name: Publish Release
environment: release
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install Nox
run: |
python -m pip install nox

- name: Build a binary wheel and a source tarball
run: |
nox -e build

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
print_hash: true
print-hash: true
skip-existing: true
verify-metadata: true
13 changes: 8 additions & 5 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
run: |
nox --force-color -e lint --install-only

- name: Build Docs
- name: Lint Code
env:
SKIP_REQUIREMENTS_INSTALL: YES
run: |
Expand Down Expand Up @@ -435,6 +435,9 @@ jobs:

Build:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
needs:
- Docs
- PyLint
Expand Down Expand Up @@ -463,7 +466,7 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
print_hash: true
repository-url: https://test.pypi.org/legacy/
print-hash: true
skip-existing: true
verify-metadata: true
4 changes: 4 additions & 0 deletions changelog/151.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Some internal processes improvements:

* Publish packages to PyPi with trusted publishers
* Enable dependabot to update the GH Actions versions on a weekly basis