-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add semantic release to CI/CD
- Loading branch information
1 parent
2982680
commit 4124b8c
Showing
4 changed files
with
442 additions
and
8 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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
name: Continuous Delivery of Python package | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
production_release: | ||
|
@@ -59,11 +56,21 @@ jobs: | |
- name: Set Git user as GitHub actions | ||
run: git config --global user.email "[email protected]" && git config --global user.name "github-actions" | ||
|
||
- name: Create Continuous Deployment - Production | ||
- name: Update release - Production | ||
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release | ||
run: | | ||
poetry build --format wheel | ||
run: semantic-release version | ||
|
||
- name: Publish package distributions to PyPI | ||
- name: Update release - Prerelease | ||
if: steps.get_branch.outputs.branch == 'main' && !inputs.production_release | ||
run: semantic-release version --prerelease | ||
|
||
- name: Create Wheel | ||
run: poetry build --format wheel | ||
|
||
- name: Publish to GitHub | ||
if: steps.get_branch.outputs.branch == 'main' | ||
run: semantic-release publish | ||
|
||
- name: Publish to PyPI | ||
if: steps.get_branch.outputs.branch == 'main' && inputs.production_release | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
Oops, something went wrong.