|
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: Setup python to build package |
20 | | - uses: actions/setup-python@v5 |
21 | | - with: |
22 | | - python-version: '3.12' |
23 | | - - name: Install build |
24 | | - run: python -m pip install build |
25 | 18 | - uses: actions/checkout@v4 |
26 | 19 | with: |
| 20 | + token: ${{ secrets.GH_RELEASE_PAT }} |
27 | 21 | fetch-depth: 0 |
28 | | - - name: Build ext package |
29 | | - run: python -m build ext/ |
30 | | - - name: Publish ext to PyPI |
31 | | - |
| 22 | + - name: Prepare release |
| 23 | + uses: getsentry/action-prepare-release@v1 |
| 24 | + env: |
| 25 | + GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} |
32 | 26 | with: |
33 | | - packages-dir: ext/dist/ |
34 | | - |
35 | | - build-and-publish: |
36 | | - runs-on: ubuntu-latest |
37 | | - needs: [build-and-publish-ext] |
38 | | - environment: |
39 | | - name: release |
40 | | - url: https://pypi.org/p/django-stubs |
41 | | - permissions: |
42 | | - id-token: write |
43 | | - steps: |
44 | | - - name: Setup python to build package |
45 | | - uses: actions/setup-python@v5 |
46 | | - with: |
47 | | - python-version: '3.12' |
48 | | - - name: Install build |
49 | | - run: python -m pip install build |
50 | | - - uses: actions/checkout@v4 |
51 | | - with: |
52 | | - fetch-depth: 0 |
53 | | - - name: Build package |
54 | | - run: python -m build |
55 | | - - name: Publish to PyPI |
56 | | - |
| 27 | + version: ${{ github.event.inputs.version }} |
| 28 | + merge_target: ${{ github.event.inputs.merge_target }} |
0 commit comments