Repository navigation
52 lines (43 loc) · 1.63 KB
/
Copy pathupdate_version.yml
File metadata and controls
52 lines (43 loc) · 1.63 KB
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
52
name: Update version
on:
workflow_dispatch:
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
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install wheel
pip install --editable .
- name: Get current date
run: echo "VERSION=$(date +'v%y.%-m')" >> $GITHUB_ENV
- name: Update version
run: python scripts/update_version.py
- name: Create Pull Request
id: version_pr
uses: peter-evans/create-pull-request@v5
with:
delete-branch: true
branch-suffix: short-commit-hash
commit-message: Update version to ${{ env.VERSION }}
title: Update to ${{ env.VERSION }}
body: |
- [x] Update to ${{ env.VERSION }}
- [ ] Check the [release checklist](https://github.com/pybamm-team/PyBaMM/blob/develop/.github/release_checklist.md)
- name: Make a PR from develop to main
uses: repo-sync/pull-request@v2
with:
destination_branch: "main"
pr_title: "Make release ${{ env.VERSION }}"
pr_body: "**DO NOT MERGE UNTIL #${{ steps.version_pr.outputs.pull-request-number }} IS MERGED.**<br><br>Make release ${{ env.VERSION }}"
github_token: ${{ secrets.GITHUB_TOKEN }}