Skip to content

Commit

Permalink
Merge pull request #32 from nens/eli-use-trusted-publishing
Browse files Browse the repository at this point in the history
update action versions, use trusted publishing
  • Loading branch information
elisalle authored Sep 10, 2024
2 parents 5ed78cf + c782cca commit d334e65
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Run black, flake8, isort
uses: pre-commit/[email protected].0
uses: pre-commit/[email protected].1
33 changes: 24 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand All @@ -34,19 +34,19 @@ jobs:
python -m pip install build
python -m build
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./dist/*
retention-days: 5

publish:
name: Publish on GitHub and PyPI
github-publish:
name: Publish on GitHub
needs: [build]
runs-on: ubuntu-latest
# release on every tag
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand All @@ -55,7 +55,22 @@ jobs:
id: upload-release-asset
uses: softprops/action-gh-release@v2

- name: Upload Release Assets to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
pypi-publish:
name: Publish on PyPI
needs: [build, github-publish]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/threedi-urban-eia-nl
# release on every tag
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v4
with:
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
name: artifact
path: dist

- name: Upload Release Assets to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

0 comments on commit d334e65

Please sign in to comment.