|
4 | 4 | types: [closed]
|
5 | 5 | branches: [master]
|
6 | 6 | workflow_dispatch:
|
7 |
| - inputs: |
8 |
| - dry_run: |
9 |
| - description: Don't actually do the work, just describe it |
10 |
| - default: true |
11 |
| - type: boolean |
12 |
| - new_version: |
13 |
| - description: Set the version to a specific value |
14 |
| - required: false |
15 |
| - type: string |
16 |
| - verbose: |
17 |
| - description: The amount of output detail |
18 |
| - default: 0 |
19 |
| - type: choice |
20 |
| - options: |
21 |
| - - "0" |
22 |
| - - "1" |
23 |
| - - "2" |
24 | 7 |
|
25 | 8 | jobs:
|
26 | 9 | bumpversion:
|
@@ -54,34 +37,44 @@ jobs:
|
54 | 37 | echo "::notice::Suggested release type is: ${RELEASE_KIND}"
|
55 | 38 | echo "RELEASE_KIND=$RELEASE_KIND" >> $GITHUB_ENV
|
56 | 39 | echo "release-kind=$RELEASE_KIND" >> $GITHUB_OUTPUT
|
| 40 | + echo "PACKAGE=false" >> $GITHUB_ENV |
57 | 41 |
|
58 | 42 | - name: Bump Version auto
|
59 | 43 | if: ${{ github.event_name != 'workflow_dispatch' }}
|
60 | 44 | shell: bash
|
61 | 45 | run: |
|
62 | 46 | if [[ $RELEASE_KIND != "no-release" ]]; then
|
63 |
| - bump-my-version -v "$RELEASE_KIND" |
| 47 | + bump-my-version bump -v "$RELEASE_KIND" |
64 | 48 | git push
|
65 | 49 | git push --tags
|
| 50 | + echo "PACKAGE=true" >> $GITHUB_ENV |
66 | 51 | fi
|
67 | 52 |
|
68 | 53 | - name: Bump Version manual
|
69 | 54 | if: ${{ github.event_name == 'workflow_dispatch' }}
|
70 | 55 | shell: bash
|
71 |
| - env: |
72 |
| - BUMPVERSION_DRY_RUN: ${{ inputs.dry_run }} |
73 |
| - BUMPVERSION_NEW_VERSION: ${{ inputs.tags }} |
74 |
| - BUMPVERSION_VERBOSE: ${{ inputs.verbose }} |
75 | 56 | run: |
|
76 | 57 | case "$RELEASE_KIND" in
|
77 | 58 | major|minor|patch)
|
78 | 59 | bump-my-version bump "$RELEASE_KIND"
|
79 | 60 | if [[ BUMPVERSION_DRY_RUN == "false" ]]; then
|
80 | 61 | git push
|
81 | 62 | git push --tags
|
| 63 | + echo "PACKAGE=true" >> $GITHUB_ENV |
82 | 64 | fi
|
83 | 65 | ;;
|
84 |
| - release-candidate) |
85 |
| - bump-my-version bump --no-commit "$RELEASE_KIND" |
| 66 | + dev) |
| 67 | + bump-my-version bump -v --no-commit "$RELEASE_KIND" |
| 68 | + echo "PACKAGE=true" >> $GITHUB_ENV |
86 | 69 | ;;
|
87 | 70 | esac
|
| 71 | +
|
| 72 | + - name: Package |
| 73 | + if: ${{ env.PACKAGE == 'true' }} |
| 74 | + uses: hynek/build-and-inspect-python-package@v1 |
| 75 | + |
| 76 | + - name: Upload dev release to PyPI |
| 77 | + if: ${{ env.PACKAGE == 'true' && env.RELEASE_KIND == 'dev' }} |
| 78 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 79 | + with: |
| 80 | + password: ${{ secrets.PYPI_API_TOKEN }} |
0 commit comments