|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - release: |
5 | | - types: [published] |
| 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 |
6 | 12 |
|
7 | 13 | jobs: |
8 | | - build-and-publish: |
9 | | - runs-on: ubuntu-latest |
10 | | - environment: |
11 | | - name: release |
12 | | - url: https://pypi.org/p/django-stubs |
13 | | - permissions: |
14 | | - id-token: write |
15 | | - steps: |
16 | | - - name: Setup python to build package |
17 | | - uses: actions/setup-python@v5 |
18 | | - with: |
19 | | - python-version: '3.12' |
20 | | - - name: Install build |
21 | | - run: python -m pip install build |
22 | | - - uses: actions/checkout@v4 |
23 | | - with: |
24 | | - fetch-depth: 0 |
25 | | - - name: Build package |
26 | | - run: python -m build |
27 | | - - name: Publish to PyPI |
28 | | - uses: pypa/gh-action-pypi-publish@v1.8.14 |
29 | | - |
30 | | - build-and-publish-ext: |
| 14 | + release: |
31 | 15 | runs-on: ubuntu-latest |
32 | | - environment: |
33 | | - name: release-ext |
34 | | - url: https://pypi.org/p/django-stubs-ext |
35 | | - permissions: |
36 | | - id-token: write |
| 16 | + name: "Release a new version" |
37 | 17 | steps: |
38 | | - - name: Setup python to build package |
39 | | - uses: actions/setup-python@v5 |
40 | | - with: |
41 | | - python-version: '3.12' |
42 | | - - name: Install build |
43 | | - run: python -m pip install build |
44 | 18 | - uses: actions/checkout@v4 |
45 | 19 | with: |
| 20 | + token: ${{ secrets.GH_RELEASE_PAT }} |
46 | 21 | fetch-depth: 0 |
47 | | - - name: Build ext package |
48 | | - run: python -m build ext/ |
49 | | - - name: Publish ext to PyPI |
50 | | - uses: pypa/gh-action-pypi-publish@v1.8.14 |
| 22 | + - name: Prepare release |
| 23 | + uses: getsentry/action-prepare-release@v1 |
| 24 | + env: |
| 25 | + GITHUB_TOKEN: ${{ secrets.GH_RELEASE_PAT }} |
51 | 26 | with: |
52 | | - packages-dir: ext/dist/ |
| 27 | + version: ${{ github.event.inputs.version }} |
| 28 | + merge_target: ${{ github.event.inputs.merge_target }} |
0 commit comments