Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add semantic release to CI/CD #26

Merged
merged 5 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/workflows/cd.yaml
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:
Expand Down Expand Up @@ -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
Loading