Skip to content

Commit

Permalink
Update deployment for OIDC and hot-fix py 3.12 issues (#45)
Browse files Browse the repository at this point in the history
* Update deployment for OIDC (trusted publisher)
* Exclude latest python from latest mda deploiyment (using hot-fix "latest", see
  MDAnalysis/cookiecutter-mdakit#93 for background)
  • Loading branch information
IAlibay authored Oct 31, 2023
1 parent 83e7bc9 commit 7edf3e0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
40 changes: 22 additions & 18 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,27 @@ jobs:
fail-fast: false
matrix:
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [macos-11, macosx_*]
- [windows-2019, win_amd64]
- [ubuntu-20.04, manylinux_x86_64, x86_64]
- [macos-11, macosx_*, x86_64]
- [windows-2019, win_amd64, AMD64]
python: ["cp39", "cp310", "cp311"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build wheels
uses: pypa/cibuildwheel@v2.11.2
uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ARCHS: ${{ matrix.buildplat[2] }}
CIBW_BUILD_VERBOSITY: 1

- name: upload artifacts
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
(github.event_name == 'release' && github.event.action == 'published')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: wheelhouse/*.whl
retention-days: 7
Expand All @@ -58,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -69,7 +70,7 @@ jobs:
if: |
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) ||
(github.event_name == 'release' && github.event.action == 'published')
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
retention-days: 7
Expand All @@ -79,20 +80,22 @@ jobs:
github.repository == 'MDAnalysis/mdaencore' &&
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
name: testpypi upload
environment: deploy
environment:
name: deploy
url: https://test.pypi.org/p/mdaencore
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: upload_source_and_wheels
uses: pypa/gh-action-pypi-publish@v1.5.0
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.TESTPYPI_API_TOKEN_SRC }}
skip_existing: true
repository_url: https://test.pypi.org/legacy/

Expand All @@ -101,20 +104,21 @@ jobs:
github.repository == 'MDAnalysis/mdaencore' &&
github.event_name == 'release' && github.event.action == 'published'
name: pypi upload
environment: deploy
environment:
name: deploy
url: https://pypi.org/p/mdaencore
permissions:
id-token: write
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: upload_source_and_wheels
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_SRC }}

check_testpypi:
if: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/gh-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
stable-python-version: ${{ steps.get-compatible-python.outputs.stable-python }}
latest-python-version: ${{ steps.get-compatible-python.outputs.latest-python }}
python-matrix: ${{ steps.get-compatible-python.outputs.python-versions }}
steps:
- uses: actions/setup-python@v4
Expand All @@ -35,6 +36,8 @@ jobs:

- id: get-compatible-python
uses: MDAnalysis/mdanalysis-compatible-python@main
with:
release: "latest"

main-tests:
if: "github.repository == 'MDAnalysis/mdaencore'"
Expand Down

0 comments on commit 7edf3e0

Please sign in to comment.