Skip to content

Release

Release #8

Workflow file for this run

name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
candidate:
description: 'Release candidate.'
required: true
type: boolean
default: true
test_pypi:
description: 'Test PyPi.'
type: boolean
default: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: '478-copulas-release-workflow-errors-with-failed-to-push-some-refs-to-httpsgithubcomsdv-devcopulas'
# ref: ${{ inputs.candidate && 'main' || 'stable' }}
- name: Set up latest Python
uses: actions/setup-python@v5
with:
python-version-file: 'pyproject.toml'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[dev]
- name: Create wheel
run: |
make dist
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: 'https://test.pypi.org/legacy/'
- name: Bump version to next candidate
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add copulas/__init__.py
git add pyproject.toml
# make bumpversion-candidate
# if: ${{ inputs.candidate && !inputs.test_pypi }}
- name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
commit-message: bumpversion-candidate
title: Automated Bump Version Candidate
body: "This is an auto-generated PR that bumps the version to the next candidate."
branch: bumpversion-candidate-update
branch-suffix: short-commit-hash
base: main
add-paths: |
copulas/__init__.py
pyproject.toml
- name: Enable Pull Request Automerge
if: ${{ steps.cpr.outputs.pull-request-operation == 'created' }}
run: gh pr merge "${{ steps.cpr.outputs.pull-request-number }}" --squash --admin
env:
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}