Skip to content

Create a release

Create a release #23

Workflow file for this run

name: "Create a release"
on:
workflow_dispatch:
inputs:
ref:
description: "Target branch"
required: true
type: string
version:
description: "New version number"
required: true
type: string
push:
description: "Make release and push to PyPI"
required: true
type: boolean
default: false
jobs:
prepare:
name: Bump version number
uses: ./.github/workflows/set_version.yml
with:
ref: ${{ inputs.ref }}
version: ${{ inputs.version }}
push: true
# build-sdist:
# needs: prepare
# name: Build and test sdist
# uses: ./.github/workflows/build_sdist.yml
# with:
# ref: ${{ inputs.ref }}
# build-wheels:
# name: Build and test wheels
# needs: prepare
# uses: ./.github/workflows/build_wheels.yml
# with:
# ref: ${{ inputs.ref }}
release:
name: Github release
# needs: [build-wheels,build-sdist]
needs: prepare
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
# fetch-depth: 1
- name: Git log, preview CHANGELOG
shell: bash -l {0}
run: |
git log | head -n 50
head CHANGELOG.rst
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Basic installation to check euphonic.__version__
shell: bash -l {0}
run: |
python -m pip install requests pyyaml
python -m pip install .
- name: Check version consistency, generate Github release page
run : |
python build_utils/release.py --github ${{ inputs.push && '--notest' || '' }}
publish:
if: ${{ inputs.push }}
needs: release
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/euphonic
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0 # This is possibly unnecessary?
- name: Download artifacts to Ubuntu environment
uses: actions/download-artifact@v4
with:
path: dist/
merge-multiple: true
- name: List Files
run: ls -R dist/
# - name: Upload wheels to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1