Skip to content

Commit

Permalink
Merge pull request #41 from kontext-tech/ci-fix
Browse files Browse the repository at this point in the history
ci: split version bump and build/publish flow.
  • Loading branch information
tang2087 authored Sep 8, 2024
2 parents bc6c8c2 + 0f31400 commit fe7ca76
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 23 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bump version

on:
push:
branches:
- main
env:
PACKAGE_NAME: kontext-copilot

jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
25 changes: 3 additions & 22 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
---
name: Publish Kontext Copilot distribution to PyPI and TestPyPI
name: Build and Publish Kontext Copilot distribution to PyPI and TestPyPI

on:
push:
branches:
- main
tags:
- "v*"
env:
PACKAGE_NAME: kontext-copilot

jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:')"
runs-on: ubuntu-latest
name: "Bump version and create changelog with commitizen"
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
token: "${{ secrets.GITHUB_TOKEN }}"
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"

build:
name: Build distribution 📦
runs-on: ubuntu-latest
needs: bump_version

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ duckdb-engine = "^0.13.1"
pyodbc = "^5.1.0"
[tool.commitizen]
name = "cz_conventional_commits"
tag_format = "$version"
tag_format = "v$version"
version_scheme = "semver2"
version_provider = "poetry"
update_changelog_on_bump = true
Expand Down

0 comments on commit fe7ca76

Please sign in to comment.