Build landing page from version.yml #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
show_tag: | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
steps: | ||
- run: echo NORMALISED TAG: ${{ needs.prepare.outputs.tag }} | ||
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] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
fetch-depth: 1 | ||
- 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 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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 | ||
landing_page: | ||
needs: [prepare,release] | ||
if: ${{ inputs.push }} | ||
name: Create landing page | ||
uses: ./github/workflows/create-landing-page.yml | ||
with: | ||
ref: ${{ needs.prepare.outputs.tag }} |