Skip to content

Commit 7fbc3a3

Browse files
authored
Redo release workflow (#4609)
Redo release workflow Summary of changes: * Instead of making a release via the GUI triggering a PyPI publishing workflow the new approach is to trigger a workflow manually. That way we can do some safety checks before publishing. * We now make releases from branches *off* `release`. This means that we can test the FIAT `release` branch against our own and also means that the version number in the `pyproject.toml` can have a `.dev0` suffix. This is useful because it means Python can distinguish between an install of the `release` branch and an actual release.
1 parent 80aeb9a commit 7fbc3a3

5 files changed

Lines changed: 60 additions & 33 deletions

File tree

.github/workflows/core.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,17 +133,6 @@ jobs:
133133
exit 1
134134
fi
135135
136-
# Raise an error if any 'TODO RELEASE' comments remain
137-
- name: Check no 'TODO RELEASE' comments (release only)
138-
if: inputs.target_branch == 'release'
139-
working-directory: firedrake-repo
140-
run: |
141-
if [ -z "$( grep -r --exclude-dir='.*' 'TODO RELEASE' )" ]; then
142-
exit 0
143-
else
144-
exit 1
145-
fi
146-
147136
- name: Install system dependencies (2)
148137
run: |
149138
apt-get -y install \

.github/workflows/release.yml

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,72 @@
11
name: Publish release
22

33
on:
4-
release:
5-
types: [released]
4+
workflow_call:
5+
inputs:
6+
branch:
7+
description: The branch to release from
8+
type: string
9+
required: true
10+
version:
11+
description: The version number to release
12+
type: string
13+
required: true
614

715
jobs:
8-
deploy:
16+
check:
17+
name: Pre-release checks
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v5
21+
with:
22+
path: firedrake-repo
23+
ref: ${{ inputs.branch }}
24+
25+
- name: Check no 'TODO RELEASE' comments remain
26+
working-directory: firedrake-repo
27+
run: |
28+
if [ -z "$( grep -r --exclude-dir='.*' 'TODO RELEASE' )" ]; then
29+
exit 0
30+
else
31+
exit 1
32+
fi
33+
34+
- name: Check version number matches
35+
working-directory: firedrake-repo
36+
run: |
37+
if [ -z "$( grep 'version = \"${{ inputs.version }}\"' pyproject.toml )" ]; then
38+
exit 1
39+
else
40+
exit 0
41+
fi
42+
43+
pypi:
944
uses: ./.github/workflows/core.yml
45+
needs: check
1046
with:
11-
source_ref: release
47+
source_ref: ${{ inputs.branch }}
1248
target_branch: release
1349
run_tests: false
1450
upload_pypi: true
1551
secrets: inherit
1652

53+
github_release:
54+
name: Create GitHub release
55+
needs: pypi
56+
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
59+
steps:
60+
- name: Create release
61+
env:
62+
GH_TOKEN: ${{ github.token }}
63+
run: gh release create ${{ inputs.version }} --title ${{ inputs.version }} --generate-notes
64+
1765
docker:
1866
name: Build Docker containers
1967
uses: ./.github/workflows/docker.yml
68+
needs: pypi
2069
with:
21-
tag: ${{ github.ref_name }}
22-
branch: ${{ github.ref_name }}
23-
build_dev: false
70+
tag: ${{ inputs.version }}
71+
branch: ${{ inputs.branch }}
2472
secrets: inherit

docs/source/install.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ firedrake-configure
6262
To simplify the installation process, Firedrake provides a utility script called
6363
``firedrake-configure``. This script can be downloaded by executing::
6464

65-
$ curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/refs/tags/2025.4.2/scripts/firedrake-configure
65+
$ curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/release/scripts/firedrake-configure
6666

6767
Unlike the now deprecated ``firedrake-install`` script, ``firedrake-configure``
6868
**does not install Firedrake for you**. It is simply a helper script that emits

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[project]
22
name = "firedrake"
33
# <year>.<month>.<patch>
4-
version = "2025.4.2"
4+
# TODO RELEASE: remove '.dev0'
5+
version = "2025.4.3.dev0"
56
description = "An automated system for the portable solution of partial differential equations using the finite element method"
67
readme = "README.rst"
78
license = "LGPL-3.0-or-later"
@@ -20,7 +21,8 @@ dependencies = [
2021
"mpi4py>3; python_version >= '3.13'",
2122
"mpi4py; python_version < '3.13'",
2223
"fenics-ufl>=2025.1.0",
23-
"firedrake-fiat>=2025.4.0",
24+
# TODO RELEASE
25+
"firedrake-fiat @ git+https://github.com/firedrakeproject/fiat.git@release",
2426
"h5py>3.12.1",
2527
"libsupermesh",
2628
"loopy>2024.1",

scripts/check-config

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,12 @@ class InvalidConfigurationException(Exception):
2020

2121

2222
def main():
23-
check_firedrake_version()
2423
check_min_python_version()
2524
check_petsc_version()
2625
check_slepc_version()
2726
check_petsc_version_spec()
2827

2928

30-
def check_firedrake_version():
31-
firedrake_version = check_file_contains_pattern(
32-
REPO_ROOT / "pyproject.toml",
33-
"version = \"(.*)\""
34-
)
35-
check_file_contains_pattern(
36-
REPO_ROOT/"docs/source/install.rst",
37-
f"https://raw.githubusercontent.com/firedrakeproject/firedrake/refs/tags/{firedrake_version}/scripts/firedrake-configure"
38-
)
39-
40-
4129
def check_min_python_version() -> None:
4230
min_python_version = check_file_contains_pattern(
4331
REPO_ROOT / "pyproject.toml",

0 commit comments

Comments
 (0)