Update version #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update version | |
on: | |
schedule: | |
# Run at 10 am UTC on day-of-month 1 in January, May, and September. | |
- cron: "0 10 1 1,5,9 *" | |
jobs: | |
update-version: | |
# This workflow is only of value to PyBaMM and would always be skipped in forks | |
if: github.repository_owner == 'pybamm-team' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date for the first release candidate | |
run: | | |
echo "VERSION=$(date +'v%y.%-m').0" >> $GITHUB_ENV | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'develop' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install dependencies | |
run: | | |
pip install -e ".[all]" | |
# Update all the version strings and add CHANGELOG headings | |
- name: Update version | |
run: python scripts/update_version.py | |
# Create a new version branch for the release and commit | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
message: 'Bump to ${{ env.VERSION }}' | |
new_branch: '${{ env.VERSION }}' | |
# Create a PR from version branch to main | |
- name: Make a PR from ${{ env.VERSION }} to main | |
id: release_pr | |
uses: repo-sync/pull-request@v2 | |
with: | |
source_branch: '${{ env.VERSION }}' | |
destination_branch: "main" | |
pr_title: "Make release ${{ env.VERSION }}" | |
pr_body: "**Check the [release workflow](https://github.com/pybamm-team/PyBaMM/blob/develop/.github/release_workflow.md)**" | |
github_token: ${{ secrets.GITHUB_TOKEN }} |