forked from kraina-ai/srai
-
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.
- Loading branch information
Showing
9 changed files
with
160 additions
and
66 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 |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: "Bump ⬆️ library version and create PR" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
bumpType: | ||
description: "Bump type" | ||
required: true | ||
default: "patch" | ||
type: choice | ||
options: | ||
- patch | ||
- minor | ||
- major | ||
|
||
env: | ||
PYTHON_VERSION: 3.11 | ||
|
||
jobs: | ||
bump-n-pr: | ||
name: Bump ⬆️ and create a Pull Request with a new library version (${{ inputs.bumpType }}) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.CICD_PAT_TOKEN }} | ||
- name: Configure Git user | ||
run: | | ||
git config --local user.name "Kraina CI/CD" | ||
git config --local user.email "[email protected]" | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- uses: pdm-project/setup-pdm@v3 | ||
name: Setup PDM (Python 3.11) | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: x64 | ||
- name: Install dependencies | ||
run: pdm install -d -G dev --skip=post_install | ||
- name: Bump changelog version | ||
id: changelog | ||
uses: release-flow/keep-a-changelog-action@v2 | ||
with: | ||
command: bump | ||
version: ${{ inputs.bumpType }} | ||
tag-prefix: "" | ||
keep-unreleased-section: True | ||
- name: Run bumpver | ||
run: | | ||
pdm run bumpver update --allow-dirty --${{ inputs.bumpType }} -vvv | ||
- name: Get commit message | ||
id: commit_message | ||
run: | | ||
echo COMMIT_MESSAGE="$(git log -1 --pretty=%B | cat)" >> $GITHUB_OUTPUT | ||
- name: Get new version | ||
id: new_version | ||
run: | | ||
pdm run bumpver show -n -e | grep CURRENT_VERSION >> $GITHUB_OUTPUT | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v5 | ||
with: | ||
title: ${{ steps.commit_message.outputs.COMMIT_MESSAGE }} | ||
branch: ${{ format('release/{0}', steps.new_version.outputs.CURRENT_VERSION) }} | ||
labels: release | ||
base: main | ||
body: ${{ steps.changelog.outputs.release-notes }} | ||
token: ${{ secrets.CICD_PAT_TOKEN }} |
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 |
---|---|---|
|
@@ -9,6 +9,35 @@ jobs: | |
name: "Run tests job" | ||
uses: ./.github/workflows/_tests.yml | ||
|
||
github-release: | ||
if: ${{ contains(github.event.head_commit.message, 'bump version') }} | ||
name: Create a GitHub release | ||
needs: [run-tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.CICD_PAT_TOKEN }} | ||
- name: Configure Git user | ||
run: | | ||
git config --local user.name "Kraina CI/CD" | ||
git config --local user.email "[email protected]" | ||
- name: Extract release notes | ||
id: extract-release-notes | ||
uses: ffurrer2/extract-release-notes@v1 | ||
- name: Extract version | ||
id: extract-version | ||
uses: winterjung/split@v2 | ||
with: | ||
msg: ${{ github.event.head_commit.message }} | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
token: ${{ secrets.CICD_PAT_TOKEN }} | ||
tag_name: ${{ steps.extract-version.outputs._5 }} | ||
body: ${{ steps.extract-release-notes.outputs.release_notes }} | ||
|
||
build-n-publish: | ||
name: Build and publish Python 🐍 distributions 📦 to TestPyPI | ||
needs: [run-tests] | ||
|
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,8 +1,7 @@ | ||
name: "Build & publish - PROD" | ||
on: | ||
push: | ||
tags: | ||
- "**" | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
run-tests: | ||
|
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
SHELL := /bin/bash | ||
|
||
install: | ||
pdm install -dG:all | ||
|
||
bump: | ||
bumpver update --patch | ||
|
||
docs: | ||
mkdocs serve --livereload -w srai | ||
|
||
test: | ||
pytest -n auto | ||
|
||
.PHONY: install bump docs test |
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,6 +1,6 @@ | ||
[project] | ||
name = "srai" | ||
version = "0.6.1" | ||
version = "0.6.3" | ||
description = "A set of python modules for geospatial machine learning and data mining" | ||
authors = [ | ||
{ name = "Piotr Gramacki", email = "[email protected]" }, | ||
|
@@ -183,7 +183,7 @@ close-quotes-on-newline = true | |
wrap-one-line = true | ||
|
||
[tool.bumpver] | ||
current_version = "0.6.1" | ||
current_version = "0.6.3" | ||
version_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" | ||
commit_message = "chore: bump version {old_version} -> {new_version}" | ||
commit = true | ||
|
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
for complete documentation. | ||
""" | ||
|
||
__version__ = "0.6.1" | ||
__version__ = "0.6.3" |