|
5 | 5 | push:
|
6 | 6 | branches: [main]
|
7 | 7 |
|
| 8 | +concurrency: |
| 9 | + group: release |
| 10 | + |
8 | 11 | jobs:
|
9 | 12 | ci:
|
10 | 13 | name: CI
|
@@ -32,46 +35,29 @@ jobs:
|
32 | 35 | run: poetry install
|
33 | 36 | - name: Find version
|
34 | 37 | id: version
|
35 |
| - uses: cycjimmy/semantic-release-action@v3 |
| 38 | + uses: open-turo/actions-release/semantic-release@v4 |
36 | 39 | with:
|
37 |
| - dry_run: true |
38 |
| - branches: | |
39 |
| - ["main"] |
40 |
| - env: |
41 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + # branches: ${{ github.head_ref }} |
| 42 | + # override-github-ref-name: ${{ github.head_ref }} |
| 43 | + dry-run: true |
| 44 | + ci: false |
| 45 | + - name: Release check |
| 46 | + if: steps.version.outputs.new-release-published != 'true' |
| 47 | + run: exit 1 |
42 | 48 | - name: Update version
|
43 |
| - if: steps.version.outputs.new_release_published == 'true' |
44 | 49 | shell: bash
|
45 |
| - run: | |
46 |
| - # Use poetry to bump the version in pyproject.toml |
47 |
| - poetry version "${{ steps.version.outputs.new_release_version }}" |
48 |
| -
|
49 |
| - |
50 |
| - NAME="Jake Alheid" |
51 |
| -
|
52 |
| - # Set our git config for pushing |
53 |
| - git config user.email "$EMAIL" |
54 |
| - git config user.name "$NAME" |
55 |
| -
|
56 |
| - # Commit the bumped project version with a non-semver chore: commit message |
57 |
| - git add pyproject.toml |
58 |
| - git --no-pager diff --staged |
59 |
| - git commit \ |
60 |
| - --author="$NAME <$EMAIL>" \ |
61 |
| - -m "chore: release ${{ steps.version.outputs.new_release_version }}" \ |
62 |
| - -m "[skip actions]" |
63 |
| -
|
64 |
| - git push || { echo "::error:: Failed to push version update for pyproject.toml, check your github-token permissions, or branch protections."; exit 1; } |
65 |
| -
|
66 |
| - # Nice logging, generate success exit code from this run step |
67 |
| - echo "::notice::Version successfully updated in pyproject.toml to ${{ steps.version.outputs.new_release_version }}." |
| 50 | + run: poetry version "${{ steps.version.outputs.new-release-version }}" |
| 51 | + - name: Commit & push version |
| 52 | + uses: actions-js/push@master |
| 53 | + with: |
| 54 | + message: "chore: ${{ steps.version.outputs.new-release-version }} [skip actions]" |
| 55 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
68 | 56 | - name: Poetry build
|
69 | 57 | run: poetry build
|
70 | 58 | - name: Publish to PyPI
|
71 |
| - if: steps.version.outputs.new_release_published == 'true' |
72 | 59 | uses: pypa/gh-action-pypi-publish@release/v1
|
73 | 60 | - name: Release
|
74 |
| - if: steps.version.outputs.new_release_published == 'true' |
75 | 61 | uses: cycjimmy/semantic-release-action@v3
|
76 | 62 | env:
|
77 | 63 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
0 commit comments