Skip to content

Commit 59f1eab

Browse files
committed
Add release workflow
1 parent a9f78c6 commit 59f1eab

File tree

3 files changed

+93
-6
lines changed

3 files changed

+93
-6
lines changed

.github/workflows/release.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
release-pypi:
10+
name: release-pypi
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
- name: Setup Poetry
18+
uses: snok/install-poetry@v1
19+
with:
20+
virtualenvs-create: true
21+
virtualenvs-in-project: true
22+
23+
- name: Load cached venv
24+
id: cached-poetry-dependencies
25+
uses: actions/cache@v3
26+
with:
27+
path: .venv
28+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
29+
30+
- name: Install dependencies
31+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
32+
run: poetry install --no-interaction --no-root
33+
34+
- name: Install dependencies
35+
run: poetry install --no-interaction
36+
37+
- name: Run tests
38+
run: |
39+
source .venv/bin/activate
40+
pytest tests/
41+
42+
- name: Make build
43+
run: make build
44+
45+
- name: Upload to Pypi
46+
run: |
47+
pip install twine
48+
twine upload --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} dist/*
49+
50+
- name: Bump version
51+
run: |
52+
CURRENT_VERSION=$(cat pyproject.toml | grep '^version\s*=\s*' | awk '{print $NF}' | tr -d \")
53+
NEW_VERSION=$(poetry run versionbump --current ${CURRENT_VERSION} patch pyproject.toml)
54+
55+
- name: Create Pull Request
56+
uses: peter-evans/create-pull-request@v3
57+
with:
58+
commit-message: Bump version
59+
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
60+
signoff: false
61+
base: main
62+
branch: version-bump
63+
delete-branch: true
64+
title: "Update version in main branch"
65+
body: |
66+
Update report
67+
- Updated pyproject.toml with new version
68+
- Auto-generated by [create-pull-request][1]
69+
70+
[1]: https://github.com/peter-evans/create-pull-request
71+
labels: |
72+
automated pr
73+
assignees: ${{ github.actor }}
74+
team-reviewers: |
75+
owners
76+
maintainers
77+
draft: false

poetry.lock

Lines changed: 11 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[tool.poetry]
22
name = "ekumenlabs_config"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = ""
55
authors = ["Guillermo Manzato <manzato@ekumenlabs.com>"]
66
license = "MIT"
77
readme = "README.md"
88

9-
#homepage = "https://github.com/Ekumen-OS/tortoise-data-migration"
10-
#repository = "https://github.com/Ekumen-OS/tortoise-data-migration"
11-
#documentation = "https://github.com/Ekumen-OS/tortoise-data-migration"
9+
homepage = "https://github.com/Ekumen-OS/ekumenlabs_config"
10+
repository = "https://github.com/Ekumen-OS/ekumenlabs_config"
11+
documentation = "https://github.com/Ekumen-OS/ekumenlabs_config"
1212

1313
keywords = ["configuration"]
1414

@@ -22,6 +22,7 @@ tortoise-orm = "^0.19.2"
2222
[tool.poetry.dev-dependencies]
2323
pytest = "^7.3.1"
2424
coverage = "^7.2.3"
25+
versionbump = "^1.1.1"
2526

2627
[build-system]
2728
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)