|
1 | 1 | name: Release
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - #push: |
5 |
| - # branches: [ 'main' ] |
| 4 | + push: |
| 5 | + branches: [ 'main', 'master' ] |
6 | 6 | workflow_dispatch:
|
7 |
| - release_force: |
8 |
| - # see https://python-semantic-release.readthedocs.io/en/latest/github-action.html#command-line-options |
9 |
| - description: 'force release be one of: [major | minor | patch]' |
10 |
| - type: choice |
11 |
| - options: |
12 |
| - - major |
13 |
| - - minor |
14 |
| - - patch |
15 |
| - default: "" |
16 |
| - required: false |
17 |
| - prerelease_token: |
18 |
| - description: 'The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the rc in `1.2.0-rc.8`.' |
19 |
| - type: choice |
20 |
| - options: |
21 |
| - - rc |
22 |
| - - beta |
23 |
| - - alpha |
24 |
| - default: rc |
25 |
| - required: false |
26 |
| - prerelease: |
27 |
| - description: "Is a pre-release" |
28 |
| - type: boolean |
29 |
| - default: false |
30 |
| - required: false |
| 7 | + inputs: |
| 8 | + release_force: |
| 9 | + # see https://python-semantic-release.readthedocs.io/en/latest/github-action.html#command-line-options |
| 10 | + description: | |
| 11 | + Force release be one of: [major | minor | patch] |
| 12 | + Leave empty for auto-detect based on commit messages. |
| 13 | + type: choice |
| 14 | + options: |
| 15 | + - "" # auto - no force |
| 16 | + - major # force major |
| 17 | + - minor # force minor |
| 18 | + - patch # force patch |
| 19 | + default: "" |
| 20 | + required: false |
| 21 | + prerelease_token: |
| 22 | + description: 'The "prerelease identifier" to use as a prefix for the "prerelease" part of a semver. Like the rc in `1.2.0-rc.8`.' |
| 23 | + type: choice |
| 24 | + options: |
| 25 | + - rc |
| 26 | + - beta |
| 27 | + - alpha |
| 28 | + default: rc |
| 29 | + required: false |
| 30 | + prerelease: |
| 31 | + description: "Is a pre-release" |
| 32 | + type: boolean |
| 33 | + default: false |
| 34 | + required: false |
31 | 35 |
|
32 | 36 | concurrency:
|
33 | 37 | group: deploy
|
|
41 | 45 | release:
|
42 | 46 | # https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
|
43 | 47 | # limit this to being run on regular commits, not the commits that semantic-release will create
|
44 |
| - if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') |
| 48 | + # but also allow manual workflow dispatch |
| 49 | + if: "!contains(github.event.head_commit.message, 'chore(release):')" |
45 | 50 | runs-on: ubuntu-latest
|
46 |
| - concurrency: release |
47 | 51 | permissions:
|
48 | 52 | # NOTE: this enables trusted publishing.
|
49 | 53 | # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1#trusted-publishing
|
|
84 | 88 | with:
|
85 | 89 | github_token: ${{ secrets.GITHUB_TOKEN }}
|
86 | 90 | force: ${{ github.event.inputs.release_force }}
|
87 |
| - prerelease: ${{ github.event.inputs.prerelease && "true" || "false" }} |
| 91 | + prerelease: ${{ github.event.inputs.prerelease }} |
88 | 92 | prerelease_token: ${{ github.event.inputs.prerelease_token }}
|
89 | 93 |
|
90 | 94 | - name: Publish package distributions to PyPI
|
|
0 commit comments