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

Versioning with poetry and automatic release #16

Merged
merged 16 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
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
49 changes: 49 additions & 0 deletions .github/workflows/create_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release a new version of the plugin
Thanhphan1147 marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
branches:
- main

jobs:
create-release:
name: Create Github release
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python - -y
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Bump Version
id: bump-version
run: |
# Bump minor version with poetry
poetry version minor
VERSION=$(poetry version --short)
echo VERSION=${VERSION} >> $GITHUB_ENV

# Tag the commit with the new version
git tag $VERSION
git push origin $VERSION

# Push version update in pyproject.toml
git config --global user.name 'IS DevOps Bot'
git config --global user.email '[email protected]'
git add .
Thanhphan1147 marked this conversation as resolved.
Show resolved Hide resolved
git commit -m "action: bump version to ${VERSION}"
git push

- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
tag: ${{ env.VERSION }}
generateReleaseNotes: true
16 changes: 16 additions & 0 deletions pyproject.toml
Thanhphan1147 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,19 @@ markers = [

[tool.pylint]
disable = "wrong-import-order"

[tool.poetry]
name = "flask-multipass-saml-groups"
version = "0.1.0"
description = "This package provides an identity provider for Flask-Multipass, which allows you to use SAML groups. It is designed to be used as a plugin for Indico."
authors = ["Your Name <[email protected]>"]
Thanhphan1147 marked this conversation as resolved.
Show resolved Hide resolved
license = "Apache-2.0 license"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Loading