Skip to content

Commit e67cff7

Browse files
committed
ci: transition to jupyterhub common release.yaml
1 parent 6f79ffc commit e67cff7

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

.github/workflows/release.yaml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
1+
# This is a GitHub workflow defining a set of jobs with a set of steps. ref:
2+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
33
#
4-
name: Upload Python Package
4+
name: Release
55

6+
# Always tests wheel building, but only publish to PyPI on pushed tags.
67
on:
7-
release:
8-
types: [released]
8+
pull_request:
9+
paths-ignore:
10+
- "docs/**"
11+
- ".github/workflows/*.yaml"
12+
- "!.github/workflows/release.yaml"
13+
push:
14+
paths-ignore:
15+
- "docs/**"
16+
- ".github/workflows/*.yaml"
17+
- "!.github/workflows/release.yaml"
18+
branches-ignore:
19+
- "dependabot/**"
20+
- "pre-commit-ci-update-config"
21+
tags: ["**"]
22+
workflow_dispatch:
923

1024
jobs:
11-
deploy:
12-
runs-on: ubuntu-latest
25+
build-release:
26+
runs-on: ubuntu-22.04
27+
permissions:
28+
# id-token=write is required for pypa/gh-action-pypi-publish, and the PyPI
29+
# project needs to be configured to trust this workflow.
30+
#
31+
# ref: https://github.com/jupyterhub/team-compass/issues/648
32+
#
33+
id-token: write
1334

1435
steps:
1536
- uses: actions/checkout@v4
1637
- uses: actions/setup-python@v5
1738
with:
18-
python-version: "3.x"
39+
python-version: "3.11"
1940

2041
- name: install build package
2142
run: |
@@ -27,12 +48,7 @@ jobs:
2748
run: |
2849
python -m build --sdist --wheel .
2950
ls -l dist
30-
sha256sum dist/* | tee SHA256SUMS
3151
32-
- name: Publish to PyPI
33-
env:
34-
TWINE_USERNAME: __token__
35-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
36-
run: |
37-
pip install twine
38-
twine upload --skip-existing dist/*
52+
- name: publish to pypi
53+
uses: pypa/gh-action-pypi-publish@release/v1
54+
if: startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)