Skip to content

Commit

Permalink
CI: Release via GH Actions (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Calychas committed Nov 16, 2023
1 parent 028e0f8 commit 16fdc2e
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 66 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/bump-and-pr.yml
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 }}
29 changes: 29 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci-prod.yml
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:
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/release.yml

This file was deleted.

58 changes: 41 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - 2023-MM-DD
## [Unreleased]

## [0.6.3] - 2023-11-16

## [0.6.2] - 2023-11-16

### Added

- CI release via GitHub Actions

### Changed

### Deprecated
Expand Down Expand Up @@ -135,7 +141,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Refactored H3Regionalizer to be faster using [h3ronpy](https://github.com/nmandery/h3ronpy) library [#311](https://github.com/srai-lab/srai/issues/311)
- BREAKING! Renamed NetworkType to OSMNetworkType and made it importable directly from `srai.loaders` [#227](https://github.com/srai-lab/srai/issues/227)
- BREAKING! Renamed osm_filter_type and grouped_osm_filter_type into OsmTagsFilter and GroupedOsmTagsFilter [#261](https://github.com/srai-lab/srai/issues/261)
- BREAKING! Renamed osm\_filter\_type and grouped\_osm\_filter\_type into OsmTagsFilter and GroupedOsmTagsFilter [#261](https://github.com/srai-lab/srai/issues/261)
- Removed osmnx dependency version cap [#303](https://github.com/srai-lab/srai/issues/303)
- BREAKING! Removed `utils` module [#128](https://github.com/srai-lab/srai/issues/128)
- `srai.utils._optional` moved to `srai._optional`
Expand Down Expand Up @@ -220,18 +226,36 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Intersection Joiner
- Geoparquet Loader

[unreleased]: https://github.com/srai-lab/srai/compare/0.6.1...HEAD
[0.6.1]: https://github.com/srai-lab/srai/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/srai-lab/srai/compare/0.5.2...0.6.0
[0.5.2]: https://github.com/srai-lab/srai/compare/0.5.1...0.5.2
[0.5.1]: https://github.com/srai-lab/srai/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/srai-lab/srai/compare/0.4.1...0.5.0
[0.4.1]: https://github.com/srai-lab/srai/compare/0.4.0...0.4.1
[0.4.0]: https://github.com/srai-lab/srai/compare/0.3.3...0.4.0
[0.3.3]: https://github.com/srai-lab/srai/compare/0.3.2...0.3.3
[0.3.2]: https://github.com/srai-lab/srai/compare/0.3.1...0.3.2
[0.3.1]: https://github.com/srai-lab/srai/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/srai-lab/srai/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/srai-lab/srai/compare/0.1.1...0.2.0
[0.1.1]: https://github.com/srai-lab/srai/compare/0.0.1...0.1.1
[0.0.1]: https://github.com/srai-lab/srai/compare/687500b...0.0.1
[Unreleased]: https://github.com/kraina-ai/srai-sandbox/compare/0.6.3...HEAD

[0.6.3]: https://github.com/kraina-ai/srai-sandbox/compare/0.6.2...0.6.3

[0.6.2]: https://github.com/kraina-ai/srai-sandbox/compare/0.6.1...0.6.2

[0.6.1]: https://github.com/kraina-ai/srai-sandbox/compare/0.6.0...0.6.1

[0.6.0]: https://github.com/kraina-ai/srai-sandbox/compare/0.5.2...0.6.0

[0.5.2]: https://github.com/kraina-ai/srai-sandbox/compare/0.5.1...0.5.2

[0.5.1]: https://github.com/kraina-ai/srai-sandbox/compare/0.5.0...0.5.1

[0.5.0]: https://github.com/kraina-ai/srai-sandbox/compare/0.4.1...0.5.0

[0.4.1]: https://github.com/kraina-ai/srai-sandbox/compare/0.4.0...0.4.1

[0.4.0]: https://github.com/kraina-ai/srai-sandbox/compare/0.3.3...0.4.0

[0.3.3]: https://github.com/kraina-ai/srai-sandbox/compare/0.3.2...0.3.3

[0.3.2]: https://github.com/kraina-ai/srai-sandbox/compare/0.3.1...0.3.2

[0.3.1]: https://github.com/kraina-ai/srai-sandbox/compare/0.3.0...0.3.1

[0.3.0]: https://github.com/kraina-ai/srai-sandbox/compare/0.2.0...0.3.0

[0.2.0]: https://github.com/kraina-ai/srai-sandbox/compare/0.1.1...0.2.0

[0.1.1]: https://github.com/kraina-ai/srai-sandbox/compare/0.0.1...0.1.1

[0.0.1]: https://github.com/kraina-ai/srai-sandbox/releases/tag/0.0.1
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ authors:
given-names: "Szymon"
orcid: "https://orcid.org/0000-0002-2047-1649"
title: "SRAI: Spatial Representations for Artificial Intelligence"
version: 0.6.1
version: 0.6.3
date-released: 2022-11-23
url: "https://kraina-ai.github.io/srai"
repository-code: "https://github.com/kraina-ai/srai"
Expand Down
15 changes: 15 additions & 0 deletions Makefile
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
4 changes: 2 additions & 2 deletions pyproject.toml
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]" },
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion srai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
for complete documentation.
"""

__version__ = "0.6.1"
__version__ = "0.6.3"

0 comments on commit 16fdc2e

Please sign in to comment.