Skip to content

Release CmdStanPy

Release CmdStanPy #59

Workflow file for this run

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@v5
- 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