|
18 | 18 | runs-on: ubuntu-latest |
19 | 19 | permissions: |
20 | 20 | contents: write |
| 21 | + pages: write |
| 22 | + id-token: write |
21 | 23 |
|
22 | 24 | steps: |
23 | 25 | - name: Checkout code |
@@ -59,10 +61,42 @@ jobs: |
59 | 61 | env: |
60 | 62 | GH_TOKEN: ${{ github.token }} |
61 | 63 |
|
| 64 | + - name: Create pypi-index directory |
| 65 | + if: steps.bump.outputs.bumped == 'true' |
| 66 | + run: | |
| 67 | + mkdir -p pypi-index |
| 68 | + cp target/wheels/*.whl pypi-index/ |
| 69 | +
|
| 70 | + - name: Generate PyPI index with dumb-pypi |
| 71 | + if: steps.bump.outputs.bumped == 'true' |
| 72 | + run: | |
| 73 | + uvx dumb-pypi --package-list <(cd ./pypi-index && ls *.whl) --output-dir pypi-index --packages-url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/ |
| 74 | +
|
| 75 | + - name: Setup Pages |
| 76 | + if: steps.bump.outputs.bumped == 'true' |
| 77 | + uses: actions/configure-pages@v5 |
| 78 | + |
| 79 | + - name: Upload Pages artifact |
| 80 | + if: steps.bump.outputs.bumped == 'true' |
| 81 | + uses: actions/upload-pages-artifact@v3 |
| 82 | + with: |
| 83 | + path: pypi-index |
| 84 | + |
| 85 | + - name: Deploy to Github Pages |
| 86 | + if: steps.bump.outputs.bumped == 'true' |
| 87 | + id: deployment |
| 88 | + uses: actions/deploy-pages@v4 |
| 89 | + |
| 90 | + - name: Commit pypi-index to repository |
| 91 | + if: steps.bump.outputs.bumped == 'true' |
| 92 | + run: | |
| 93 | + git add pypi-index |
| 94 | + git commit -m "Add PyPI index for ${{ steps.bump.outputs.git-tag }}" |
| 95 | + git push origin HEAD:${{ github.ref }} |
| 96 | +
|
62 | 97 | - name: Push bumped version |
63 | 98 | if: steps.bump.outputs.bumped == 'true' |
64 | 99 | run: | |
65 | | - target_ref=${{ github.head_ref && format('refs/heads/{0}', github.head_ref) || github.ref }} |
66 | 100 | git push origin HEAD:${{ github.ref }} |
67 | 101 | git push origin ${{ steps.bump.outputs.git-tag }} |
68 | 102 |
|
|
0 commit comments