|
| 1 | +--- |
| 2 | +name: "Prerelease" |
| 3 | + |
| 4 | +permissions: {} |
| 5 | + |
| 6 | +on: |
| 7 | + release: |
| 8 | + types: [ "prereleased" ] |
| 9 | + |
| 10 | +jobs: |
| 11 | + checks: |
| 12 | + permissions: |
| 13 | + contents: "read" |
| 14 | + uses: "./.github/workflows/checks.yaml" |
| 15 | + secrets: |
| 16 | + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" |
| 17 | + |
| 18 | + publish: |
| 19 | + permissions: |
| 20 | + contents: "write" |
| 21 | + id-token: "write" |
| 22 | + runs-on: "ubuntu-latest" |
| 23 | + environment: |
| 24 | + name: "testpypi" |
| 25 | + url: "https://test.pypi.org/project/pushover_complete" |
| 26 | + needs: [ "checks" ] |
| 27 | + steps: |
| 28 | + - name: "Download distributions from build artifacts" |
| 29 | + uses: "actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e" # v4.2.1 |
| 30 | + with: |
| 31 | + name: "distributions" |
| 32 | + path: "dist" |
| 33 | + |
| 34 | + - name: "Get dist paths" |
| 35 | + id: "dist-paths" |
| 36 | + run: | |
| 37 | + sdist_path=$(find dist -name '*.tar.gz' | head -n1) |
| 38 | + echo "SDIST_PATH=${sdist_path}" | tee -a "$GITHUB_OUTPUT" |
| 39 | + echo "SDIST_NAME=${sdist_path#dist/}" | tee -a "$GITHUB_OUTPUT" |
| 40 | + wheel_path=$(find dist -name '*.whl' | head -n1) |
| 41 | + echo "WHEEL_PATH=${wheel_path}" | tee -a "$GITHUB_OUTPUT" |
| 42 | + echo "WHEEL_NAME=${wheel_path#dist/}" | tee -a "$GITHUB_OUTPUT" |
| 43 | +
|
| 44 | + - name: "Upload sdist to release asset" |
| 45 | + uses: "actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5" |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 48 | + with: |
| 49 | + upload_url: "${{ github.event.release.upload_url }}" |
| 50 | + asset_path: "${{ steps.dist-paths.outputs.SDIST_PATH }}" |
| 51 | + asset_name: "${{ steps.dist-paths.outputs.SDIST_NAME }}" |
| 52 | + asset_content_type: "application/x-gtar" |
| 53 | + - name: "Upload wheel to release asset" |
| 54 | + uses: "actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5" |
| 55 | + env: |
| 56 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 57 | + with: |
| 58 | + upload_url: "${{ github.event.release.upload_url }}" |
| 59 | + asset_path: "${{ steps.dist-paths.outputs.WHEEL_PATH }}" |
| 60 | + asset_name: "${{ steps.dist-paths.outputs.WHEEL_NAME }}" |
| 61 | + asset_content_type: "application/x-pywheel+zip" |
| 62 | + |
| 63 | + - name: "Publish to PyPI" |
| 64 | + uses: "pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc" # v1.12.4 |
| 65 | + with: |
| 66 | + repository-url: "https://test.pypi.org/legacy/" |
| 67 | + print-hash: true |
| 68 | +... |
0 commit comments