Skip to content

Commit 07f14e3

Browse files
Used trusted publisher for PyPi (backport #88) (#134)
Co-authored-by: Steve Wood <[email protected]>
1 parent 9ccfcde commit 07f14e3

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/deploy-code.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This code is part of a Qiskit project.
22
#
3-
# (C) Copyright IBM 2021, 2022.
3+
# (C) Copyright IBM 2021, 2023.
44
#
55
# This code is licensed under the Apache License, Version 2.0. You may
66
# obtain a copy of this license in the LICENSE.txt file in the root directory
@@ -20,6 +20,9 @@ on:
2020
jobs:
2121
code_publish:
2222
runs-on: ubuntu-latest
23+
environment: release
24+
permissions:
25+
id-token: write
2326
strategy:
2427
matrix:
2528
python-version: [3.8]
@@ -28,12 +31,12 @@ jobs:
2831
- uses: actions/setup-python@v4
2932
with:
3033
python-version: ${{ matrix.python-version }}
34+
- name: Install deps
35+
run: pip install -U pip setuptools virtualenv wheel
36+
- name: Build sdist
37+
run: python3 setup.py sdist bdist_wheel
38+
- uses: actions/upload-artifact@v3
39+
with:
40+
path: ./dist/*
3141
- name: Deploy to Pypi
32-
env:
33-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
34-
TWINE_USERNAME: qiskit
35-
run : |
36-
pip install -U twine pip setuptools virtualenv wheel
37-
python3 setup.py sdist bdist_wheel
38-
twine upload dist/qiskit*
39-
shell: bash
42+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)