Skip to content

Commit cc23c59

Browse files
authored
Switch to trusted publishers (#9)
1 parent 6c5a813 commit cc23c59

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/release.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
- '*'
77

88
jobs:
9-
deploy-package:
10-
name: Publish package
9+
build-package:
10+
name: Build package for publication
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
@@ -24,15 +24,27 @@ jobs:
2424

2525
- uses: actions/upload-artifact@v4
2626
with:
27+
name: openqasm3_pygments-dist
2728
path: |
2829
./dist/*.whl
2930
./dist/*.tar.gz
3031
31-
- name: Publish to PyPI
32-
env:
33-
TWINE_USERNAME: __token__
34-
TWINE_PASSWORD: ${{ secrets.OPENQASM_BOT_PYPI_TOKEN }}
35-
run: twine upload dist/*.whl dist/*.tar.gz
32+
deploy-package:
33+
name: Deploy package to PyPI
34+
runs-on: ubuntu-latest
35+
needs: ["build-package"]
36+
environment: release
37+
permissions:
38+
id-token: write
39+
steps:
40+
- uses: actions/download-artifact@v4
41+
with:
42+
name: openqasm3_pygments-dist
43+
path: dist
44+
45+
- uses: pypa/gh-action-pypi-publish@release/v1
46+
with:
47+
packages-dir: dist
3648

3749
- name: Publish to GitHub
3850
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)