-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from lpm0073/next
automate PyPi version number bump
- Loading branch information
Showing
6 changed files
with
41 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,33 @@ jobs: | |
with: | ||
persist-credentials: false | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Get current version | ||
id: current_version | ||
run: | | ||
echo "::set-output name=version::$(python -c 'from __version__ import __version__; print(__version__)')" | ||
- name: Get next version | ||
id: next_version | ||
run: | | ||
echo "::set-output name=version::$(npx semantic-release --dry-run | grep 'The next release version is' | cut -d ' ' -f6)" | ||
- name: Update __version__ | ||
if: steps.current_version.outputs.version != steps.next_version.outputs.version | ||
run: | | ||
echo "__version__ = '${{ steps.next_version.outputs.version }}'" > __version__.py | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add __version__.py | ||
git commit -m "chore: [gh] Update __version__.py to ${{ steps.next_version.outputs.version }}" | ||
git push https://${{ secrets.PAT }}@github.com/${{ github.repository }}.git HEAD:main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
id: semantic | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
__version__ = "0.1.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters