From 5878979e149ef990e1ae567dd1b5e52f0d411b5c Mon Sep 17 00:00:00 2001 From: Kevin Tian Date: Tue, 17 Oct 2023 14:54:15 -0400 Subject: [PATCH] migrate pypi trusted publisher (#750) --- .github/workflows/deploy.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1acdafa99..f79b2ba33 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -20,6 +20,9 @@ on: jobs: Deploy: runs-on: ubuntu-latest + environment: release + permissions: + id-token: write strategy: matrix: python-version: [3.9] @@ -28,12 +31,12 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Install deps + run: pip install -U pip setuptools build + - name: Build sdist + run: python3 -m build + - uses: actions/upload-artifact@v3 + with: + path: ./dist/* - name: Deploy to Pypi - env: - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - TWINE_USERNAME: qiskit - run : | - pip install -U twine pip setuptools virtualenv wheel - python3 setup.py sdist bdist_wheel - twine upload dist/qiskit* - shell: bash \ No newline at end of file + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file