diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml new file mode 100644 index 0000000..630ae8b --- /dev/null +++ b/.github/workflows/publish-package.yml @@ -0,0 +1,32 @@ +--- +name: Publish package + +on: + workflow_call: + secrets: + registry_token: + description: The package registry token. + required: true + +jobs: + publish: + name: Publish package + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup + uses: ./.github/actions/setup + with: + install_dependencies: 'false' + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: ${{ github.sha }} + path: dist/ + - name: Publish + run: poetry publish --skip-existing -u $USERNAME -p $PASSWORD + env: + USERNAME: __token__ + PASSWORD: ${{ secrets.registry_token }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e0462c1..f90f079 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,23 +48,7 @@ jobs: files: dist/* pypi: name: PyPI - runs-on: ubuntu-latest - timeout-minutes: 30 + uses: ./.github/workflows/publish-package.yml needs: artifacts - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup - uses: ./.github/actions/setup - with: - install_dependencies: 'false' - - name: Download artifacts - uses: actions/download-artifact@v3 - with: - name: ${{ github.sha }} - path: dist/ - - name: Publish - run: poetry publish --skip-existing -u $USERNAME -p $PASSWORD - env: - USERNAME: __token__ - PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + secrets: + registry_token: ${{ secrets.PYPI_API_TOKEN }}