|
5 | 5 | types: [created]
|
6 | 6 |
|
7 | 7 | jobs:
|
8 |
| - build: |
| 8 | + fix_release_deps: |
| 9 | + permissions: write-all |
9 | 10 | runs-on: ubuntu-latest
|
10 |
| - |
11 | 11 | steps:
|
12 | 12 | - uses: actions/checkout@v3
|
13 | 13 | - uses: actions/setup-python@v4
|
14 | 14 | with:
|
15 | 15 | python-version: '3.11'
|
16 | 16 |
|
| 17 | + - name: Install dependencies |
| 18 | + run: | |
| 19 | + python -m pip install --upgrade pip pip-tools setuptools |
| 20 | +
|
| 21 | + - name: Set configuration |
| 22 | + run: | |
| 23 | + git config --global user.name "${GITHUB_ACTOR}" |
| 24 | + git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" |
| 25 | +
|
| 26 | + - name: Create requirements files |
| 27 | + run: | |
| 28 | + python tools/generate_requirements_txt.py |
| 29 | + pip-compile -o requirements_full.txt pyproject.toml |
| 30 | + git add requirements_full.txt requirements.txt |
| 31 | + git commit -m "Updated requirements.txt files" || true |
| 32 | +
|
| 33 | + - name: Bump version to new tag |
| 34 | + run: | |
| 35 | + python -m pip install bump-my-version |
| 36 | + bump-my-version bump --new-version $GITHUB_REF_NAME patch |
| 37 | + git commit -am "Bump version to: $GITHUB_REF_NAME" |
| 38 | +
|
| 39 | + - name: Push back changes to main and tag |
| 40 | + run: | |
| 41 | + git tag --force $GITHUB_REF_NAME HEAD |
| 42 | + git push --force --tags |
| 43 | + git switch -C main |
| 44 | + git push --set-upstream -f origin main |
| 45 | +
|
| 46 | + deploy: |
| 47 | + needs: fix_release_deps |
| 48 | + runs-on: ubuntu-latest |
| 49 | + environment: release |
| 50 | + permissions: |
| 51 | + # IMPORTANT: this permission is mandatory for trusted publishing |
| 52 | + id-token: write |
| 53 | + |
| 54 | + steps: |
| 55 | + - uses: actions/checkout@v3 |
| 56 | + with: |
| 57 | + ref: ${{ github.ref_name }} |
| 58 | + |
| 59 | + - uses: actions/setup-python@v4 |
| 60 | + with: |
| 61 | + python-version: '3.12' |
| 62 | + |
17 | 63 | - name: Install dependencies
|
18 | 64 | run: |
|
19 | 65 | python -m pip install --upgrade pip
|
20 |
| - pip install -U build setuptools wheel |
| 66 | + python -m pip install build setuptools>=61.2 wheel |
21 | 67 | python -m build --no-isolation
|
22 | 68 |
|
23 | 69 | - name: Publish package
|
24 | 70 | uses: pypa/gh-action-pypi-publish@release/v1
|
25 |
| - with: |
26 |
| - user: __token__ |
27 |
| - password: ${{ secrets.PYPI_TOKEN }} |
|
0 commit comments