Skip to content

Commit

Permalink
Merge pull request #3413 from Saransh-cpp/improve-release-workflow
Browse files Browse the repository at this point in the history
Improve release workflow, add a note, bump version manually
  • Loading branch information
Saransh-cpp committed Oct 17, 2023
1 parent 50be8a5 commit e00be74
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/release_workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file contains the workflow required to make a `PyBaMM` release on GitHub an

## rc0 releases (automated)

1. The `update_version.yml` workflow will run on every 1st of January, May and September, updating incrementing the version to `YY.MMrc0` by running `scripts/update_version.py` in the following files -
1. The `update_version.yml` workflow will run on every 1st of January, May and September, updating incrementing the version to `vYY.MMrc0` by running `scripts/update_version.py` in the following files -

- `pybamm/version.py`
- `docs/conf.py`
Expand All @@ -13,21 +13,21 @@ This file contains the workflow required to make a `PyBaMM` release on GitHub an
- `docs/_static/versions.json`
- `CHANGELOG.md`

These changes will be automatically pushed to a new branch `YY.MM`.
These changes will be automatically pushed to a new branch `vYY.MM` and a PR from `vvYY.MM` to `develop` will be created (to sync the branches).

2. Create a new GitHub _pre-release_ with the tag `YY.MMrc0` from the `YY.MM` branch and a description copied from `CHANGELOG.md`.
2. Create a new GitHub _pre-release_ with the tag `vYY.MMrc0` from the `vYY.MM` branch and a description copied from `CHANGELOG.md`.

3. This release will automatically trigger `publish_pypi.yml` and create a _pre-release_ on PyPI.

## rcX releases (manual)

If a new release candidate is required after the release of `rc0` -

1. Fix a bug in `YY.MM` (no new features should be added to `YY.MM` once `rc0` is released) and `develop` individually.
1. Fix a bug in `vYY.MM` (no new features should be added to `vYY.MM` once `rc0` is released) and `develop` individually.

2. Run `update_version.yml` manually while using `append_to_tag` to specify the release candidate version number (`rc1`, `rc2`, ...).

3. This will increment the version to `YY.MMrcX` by running `scripts/update_version.py` in the following files -
3. This will increment the version to `vYY.MMrcX` by running `scripts/update_version.py` in the following files -

- `pybamm/version.py`
- `docs/conf.py`
Expand All @@ -36,9 +36,9 @@ If a new release candidate is required after the release of `rc0` -
- `docs/_static/versions.json`
- `CHANGELOG.md`

These changes will be automatically pushed to the existing branch `YY.MM`.
These changes will be automatically pushed to the existing `vYY.MM` branch and a PR from `vvYY.MM` to `develop` will be created (to sync the branches).

4. Create a new GitHub _pre-release_ with the same tag (`YY.MMrcX`) from the `YY.MM` branch and a description copied from `CHANGELOG.md`.
4. Create a new GitHub _pre-release_ with the same tag (`vYY.MMrcX`) from the `vYY.MM` branch and a description copied from `CHANGELOG.md`.

5. This release will automatically trigger `publish_pypi.yml` and create a _pre-release_ on PyPI.

Expand All @@ -48,7 +48,7 @@ Once satisfied with the release candidates -

1. Run `update_version.yml` manually, leaving the `append_to_tag` field blank ("") for an actual release.

2. This will increment the version to `YY.MMrcX` by running `scripts/update_version.py` in the following files -
2. This will increment the version to `vYY.MMrcX` by running `scripts/update_version.py` in the following files -

- `pybamm/version.py`
- `docs/conf.py`
Expand All @@ -57,9 +57,9 @@ Once satisfied with the release candidates -
- `docs/_static/versions.json`
- `CHANGELOG.md`

These changes will be automatically pushed to the existing branch `YY.MM`.
These changes will be automatically pushed to the existing `vYY.MM` branch and a PR from `vvYY.MM` to `develop` will be created (to sync the branches).

3. Next, a PR from `YY.MM` to `main` will be generated that should be merged once all the tests pass.
3. Next, a PR from `vYY.MM` to `main` will be generated that should be merged once all the tests pass.

4. Create a new GitHub _release_ with the same tag from the `main` branch and a description copied from `CHANGELOG.md`.

Expand All @@ -72,3 +72,8 @@ Some other essential things to check throughout the release process -
- If updating our custom vcpkg registory entries [pybamm-team/sundials-vcpkg-registry](https://github.com/pybamm-team/sundials-vcpkg-registry) or [pybamm-team/casadi-vcpkg-registry](https://github.com/pybamm-team/casadi-vcpkg-registry) (used to build Windows wheels), make sure to update the baseline of the registories in vcpkg-configuration.json to the latest commit id.
- Update jax and jaxlib to the latest version in `pybamm.util` and `setup.py`, fixing any bugs that arise
- Make sure the URLs in `docs/_static/versions.json` are valid
- As the release workflow is initiated by the `release` event, it's important to note that the default `GITHUB_REF` used by `actions/checkout` during the checkout process will correspond to the tag created during the release process. Consequently, the workflows will consistently build PyBaMM based on the commit associated with this tag. Should new commits be introduced to the `vYY.MM` branch, such as those addressing build issues, it becomes necessary to manually update this tag to point to the most recent commit -
```
git tag -f <tag_name> <commit_hash>
git push origin <tag_name> # can only be carried out by the maintainers
```
10 changes: 10 additions & 0 deletions .github/workflows/update_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,17 @@ jobs:
with:
message: 'Bump to ${{ env.VERSION }}'

- name: Make a PR from ${{ env.NON_RC_VERSION }} to develop
uses: repo-sync/pull-request@v2
with:
source_branch: '${{ env.NON_RC_VERSION }}'
destination_branch: "develop"
pr_title: "Sync ${{ env.NON_RC_VERSION }} and develop"
pr_body: "**Merge as soon as possible to avoid potential conflicts.**"
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Make a PR from ${{ env.NON_RC_VERSION }} to main
id: release_pr
if: github.event_name == 'workflow_dispatch' && !startsWith(github.event.inputs.append_to_tag, 'rc')
uses: repo-sync/pull-request@v2
with:
Expand Down

0 comments on commit e00be74

Please sign in to comment.