From 4fb2678ad34ab00b8c65e9eee8421a3b3c4c50ad Mon Sep 17 00:00:00 2001 From: woodsp-ibm Date: Thu, 12 Oct 2023 15:51:59 -0400 Subject: [PATCH] Used trusted publisher for PyPi --- .github/workflows/deploy-code.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy-code.yml b/.github/workflows/deploy-code.yml index f0cb24b..5f9c949 100644 --- a/.github/workflows/deploy-code.yml +++ b/.github/workflows/deploy-code.yml @@ -20,6 +20,9 @@ on: jobs: code_publish: runs-on: ubuntu-latest + environment: release + permissions: + id-token: write strategy: matrix: python-version: [3.8] @@ -28,12 +31,12 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + - name: Install deps + run: pip install -U pip setuptools virtualenv wheel + - name: Build sdist + run: python3 setup.py sdist bdist_wheel + - uses: actions/upload-artifact@v3 + with: + path: ./dist/* - name: Deploy to Pypi - env: - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} - TWINE_USERNAME: qiskit - run : | - pip install -U twine pip setuptools virtualenv wheel - python3 setup.py sdist bdist_wheel - twine upload dist/qiskit* - shell: bash + uses: pypa/gh-action-pypi-publish@release/v1