Skip to content

Commit 77d82aa

Browse files
authored
Merge pull request #5 from bimdata/chores/new-ci-publish-workflow
Trying to rework the ci for pypi upload.
2 parents d35212c + b8d0ce5 commit 77d82aa

2 files changed

Lines changed: 12 additions & 20 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
python setup.py sdist
2222
twine check dist/*
2323
24+
# taken from https://python-semantic-release.readthedocs.io/en/latest/migrating_from_v7.html
2425
release:
2526
runs-on: self-hosted
2627
needs: test
@@ -29,26 +30,19 @@ jobs:
2930
refs/heads/main'
3031
, github.ref)
3132
concurrency: release
33+
permissions:
34+
id-token: write
3235
steps:
3336
- uses: actions/checkout@v3
3437
with:
3538
fetch-depth: 0
36-
- name: Set up Python
37-
uses: actions/setup-python@v4
39+
- name: Python Semantic Release
40+
id: release
41+
uses: python-semantic-release/python-semantic-release@v9.7.3
3842
with:
39-
python-version: 3.11
40-
- name: Install ci requirements
41-
run: pip install -r ci-requirements.txt
42-
- name: Release
43-
run: |
44-
git config --global user.email "infra@bimdata.io"
45-
git config --global user.name "GA"
46-
PYTHONPATH=$PWD python setup.py sdist
47-
PYTHONPATH=$PWD semantic-release version
48-
PYTHONPATH=$PWD twine upload --non-interactive dist/*
49-
PYTHONPATH=$PWD semantic-release publish
50-
env:
51-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
53-
TWINE_USERNAME: __token__
54-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
- name: Publish package distributions to PyPI
45+
uses: pypa/gh-action-pypi-publish@release/v1
46+
# NOTE: DO NOT wrap the conditional in ${{ }} as it will always evaluate to true.
47+
# See https://github.com/actions/runner/issues/1173
48+
if: steps.release.outputs.released == 'true'

ci-requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)