Skip to content

Commit 0fbea80

Browse files
committed
Backport PR #1657: CI/automate release to PyPI (#1657)
* feat: switch to publishing to PyPI on pushing a version tag, using trusted publishing (via Trusted Publisher Management in PyPI) Signed-off-by: F.N. Claessen <felix@seita.nl> * docs: add note about excluding dev versions Signed-off-by: F.N. Claessen <felix@seita.nl> * docs: changelog entry Signed-off-by: F.N. Claessen <felix@seita.nl> * docs: add release date for v0.27.1 Signed-off-by: F.N. Claessen <felix@seita.nl> --------- Signed-off-by: F.N. Claessen <felix@seita.nl> (cherry picked from commit 0a4dda5)
1 parent 4a7e846 commit 0fbea80

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+\.[0-9]+\.[0-9]+' # Match tags that resemble a version (no dev versions)
7+
8+
jobs:
9+
build-and-publish:
10+
name: Build and publish Python package
11+
runs-on: ubuntu-latest
12+
environment:
13+
name: pypi
14+
url: https://pypi.org/p/flexmeasures
15+
16+
permissions:
17+
contents: read
18+
id-token: write
19+
20+
steps:
21+
- name: Check out the repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: "3.11"
28+
29+
- name: Upgrade pip and install build
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install build
33+
34+
- name: Build the package
35+
run: python -m build
36+
37+
- name: Check distribution metadata
38+
run: |
39+
pip install twine
40+
twine check dist/*
41+
42+
- name: Publish to PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1

documentation/changelog.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FlexMeasures Changelog
55

66

77

8-
v0.27.1 | July XX, 2025
8+
v0.27.1 | August 11, 2025
99
============================
1010

1111
Bugfixes
@@ -14,6 +14,10 @@ Bugfixes
1414
* Fix a few UI grievances in asset creation, esp. child assets [see `PR #1629 <https://github.com/FlexMeasures/flexmeasures/pull/1629>`_]
1515
* Fix updating the URL query parameters upon date selection in the UI of servers in play mode [see `PR #1649 <https://github.com/FlexMeasures/flexmeasures/pull/1649>`_]
1616

17+
Infrastructure / Support
18+
----------------------
19+
* Automate release process to PyPI [see `PR #1657 <https://github.com/FlexMeasures/flexmeasures/pull/1657>`_]
20+
1721

1822
v0.27.0 | July 20, 2025
1923
============================

0 commit comments

Comments
 (0)