|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
6 | | - |
7 | | -concurrency: |
8 | | - group: release-${{ github.event.release.tag_name }} |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: Version to release |
| 8 | + required: true |
| 9 | + merge_target: |
| 10 | + description: Target branch to merge into. Uses the default branch as a fallback (optional) |
| 11 | + required: true |
9 | 12 |
|
10 | 13 | jobs: |
11 | | - build-and-publish-ext: |
| 14 | + release: |
12 | 15 | runs-on: ubuntu-latest |
13 | | - environment: |
14 | | - name: release-ext |
15 | | - url: https://pypi.org/p/django-stubs-ext |
16 | | - permissions: |
17 | | - id-token: write |
| 16 | + name: "Release a new version" |
18 | 17 | steps: |
19 | | - - name: Install uv & Python |
20 | | - uses: astral-sh/setup-uv@v7 |
| 18 | + - name: Get auth token |
| 19 | + id: token |
| 20 | + uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 |
21 | 21 | with: |
22 | | - python-version: "3.13" |
23 | | - - uses: actions/checkout@v5 |
| 22 | + app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }} |
| 23 | + private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }} |
| 24 | + - uses: actions/checkout@v4 |
24 | 25 | with: |
| 26 | + token: ${{ steps.token.outputs.token }} |
25 | 27 | fetch-depth: 0 |
26 | | - - name: Build ext package |
27 | | - run: uv build --package=django-stubs-ext |
28 | | - - name: Publish ext to PyPI |
29 | | - |
30 | | - |
31 | | - build-and-publish: |
32 | | - runs-on: ubuntu-latest |
33 | | - needs: [build-and-publish-ext] |
34 | | - environment: |
35 | | - name: release |
36 | | - url: https://pypi.org/p/django-stubs |
37 | | - permissions: |
38 | | - id-token: write |
39 | | - steps: |
40 | | - - name: Install uv & Python |
41 | | - uses: astral-sh/setup-uv@v7 |
| 28 | + - name: Prepare release |
| 29 | + uses: getsentry/action-prepare-release@v1 |
| 30 | + env: |
| 31 | + GITHUB_TOKEN: ${{ steps.token.outputs.token }} |
42 | 32 | with: |
43 | | - python-version: "3.13" |
44 | | - - uses: actions/checkout@v5 |
45 | | - with: |
46 | | - fetch-depth: 0 |
47 | | - - name: Build package |
48 | | - run: uv build --package=django-stubs |
49 | | - - name: Publish to PyPI |
50 | | - |
| 33 | + version: ${{ github.event.inputs.version }} |
| 34 | + merge_target: ${{ github.event.inputs.merge_target }} |
0 commit comments