diff --git a/.github/workflows/publish-main.yml b/.github/workflows/publish-main.yml index d76d1b0..5b5888d 100644 --- a/.github/workflows/publish-main.yml +++ b/.github/workflows/publish-main.yml @@ -6,10 +6,11 @@ on: #branches: # - main +# TODO: De-duplicate with build-test.yml # TODO: De-duplicate with python-publish-release.yml jobs: - deploy: + build: runs-on: ubuntu-latest steps: - name: Checkout code @@ -38,8 +39,32 @@ jobs: CI_VERSION_BUILD_NUMBER: ${{ github.run_id }} run: python setup.py sdist bdist_wheel + - name: Upload artifacts + uses: actions/uplaod-artifact@v3 + with: + name: python-dist + path: dist/ + + + pypi-publish: + name: Upload release to Test PyPI + runs-on: ubuntu-latest + environment: + name: TestPyPI + url: https://test.pypi.org/project/staticx/ + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: python-dist + + - name: Display downloaded files + run: ls -R + - name: Publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_TEST_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }} - run: twine upload --repository-url https://test.pypi.org/legacy/ dist/* + uses: pypa/gh-action-pypi-publish@release/v1 + with: + print-hash: true + repository-url: https://test.pypi.org/legacy/