forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (42 loc) · 1.57 KB
/
update_version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 }}