Skip to content

Commit

Permalink
build: add semantic release to CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Dec 14, 2023
1 parent 2982680 commit 4124b8c
Show file tree
Hide file tree
Showing 4 changed files with 442 additions and 8 deletions.
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

0 comments on commit 4124b8c

Please sign in to comment.