forked from stan-dev/cmdstanpy
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (72 loc) · 2.54 KB
/
release.yml
File metadata and controls
90 lines (72 loc) · 2.54 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release CmdStanPy
on:
workflow_dispatch:
inputs:
new_version:
description: "New version, for example: 0.9.69"
required: true
jobs:
release-cmdstanpy:
name: publish release
runs-on: ubuntu-latest
environment: publishing
permissions:
id-token: write # OIDC
contents: write
steps:
- name: Check out source code
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
- name: Install os dependencies
run: |
sudo apt-get update -y
sudo apt-get install pandoc -y
- name: Install dependencies (python)
run: |
python -m pip install --upgrade pip wheel build
pip install -e .[docs,test]
- name: Install CmdStan
run: |
python -m cmdstanpy.install_cmdstan --verbose --cores 4
- name: Setup git identity
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Create release branch
run: |
git checkout -b release/v${{ github.event.inputs.new_version }}
sed -i 's/^__version__ = .*$/__version__ = '\''${{ github.event.inputs.new_version }}'\''/g' cmdstanpy/_version.py
cd docsrc
make github
cd ..
git add .
git commit -m "release/v${{ github.event.inputs.new_version }}: updating version numbers"
git push -u origin release/v${{ github.event.inputs.new_version }}
- name: Merge into develop
run: |
git checkout develop
git reset --hard release/v${{ github.event.inputs.new_version }}
git push origin develop
- name: Tag version
run: |
git checkout develop
git tag -a "v${{ github.event.inputs.new_version }}" -m "Tagging v${{ github.event.inputs.new_version }}"
git push origin "v${{ github.event.inputs.new_version }}"
- name: Update master to new released version
run: |
git fetch origin
git checkout master
git pull
git reset --hard v${{ github.event.inputs.new_version }}
git push -f origin master
- name: Build wheel
run: python -m build
- name: Install bdist_wheel
run: pip install dist/*.whl
- name: Publish on PyPI
if: success()
uses: pypa/gh-action-pypi-publish@v1.13.0
with:
packages-dir: dist/
skip-existing: true