Skip to content

Commit 0b6b707

Browse files
authored
Merge pull request #818 from stan-dev/oidc-publishing
Update release CI to use trusted publishing
2 parents 5611f3e + cc767e0 commit 0b6b707

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
name: ReleaseCmdStanPy
1+
name: Release CmdStanPy
22

33
on:
44
workflow_dispatch:
55
inputs:
66
new_version:
7-
description: 'New version, for example: 0.9.69'
7+
description: "New version, for example: 0.9.69"
88
required: true
99

1010
jobs:
1111
release-cmdstanpy:
12-
name: publish release and update read the docs default version
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
os: [ubuntu-latest]
17-
python-version: [3.9]
18-
fail-fast: false
12+
name: publish release
13+
runs-on: ubuntu-latest
14+
environment: publishing
15+
permissions:
16+
id-token: write # OIDC
17+
contents: write
18+
1919
steps:
2020
- name: Check out source code
2121
uses: actions/checkout@v5
2222

23-
- name: Set up Python ${{ matrix.python-version }}
23+
- name: Set up Python
2424
uses: actions/setup-python@v6
25-
with:
26-
python-version: ${{ matrix.python-version }}
2725

2826
- name: Install os dependencies
2927
run: |
@@ -32,7 +30,7 @@ jobs:
3230
3331
- name: Install dependencies (python)
3432
run: |
35-
python -m pip install --upgrade pip wheel build twine requests
33+
python -m pip install --upgrade pip wheel build
3634
pip install -e .[docs,test]
3735
3836
- name: Install CmdStan
@@ -84,9 +82,9 @@ jobs:
8482
- name: Install bdist_wheel
8583
run: pip install dist/*.whl
8684

87-
- name: Upload to pypi
85+
- name: Publish on PyPI
8886
if: success()
89-
env:
90-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
91-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
92-
run: python -m twine upload -u ${TWINE_USERNAME} -p ${TWINE_PASSWORD} --skip-existing dist/*
87+
uses: pypa/[email protected]
88+
with:
89+
packages-dir: dist/
90+
skip-existing: true

0 commit comments

Comments
 (0)