Skip to content

v1.0.3

v1.0.3 #4

Workflow file for this run

# SPDX-FileCopyrightText: Copyright © Idiap Research Institute <[email protected]>
# SPDX-FileContributor: Yannick Dayer <[email protected]>
# SPDX-License-Identifier: GPL-3.0-only
name: deploy release
on:
release:
types: [published]
jobs:
release-packaging:
name: Package the project into a deploy-ready state
runs-on: ubuntu-22.04
steps:
- name: Checkout project
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build dependencies
run: |
pip install --upgrade pip
pip install build
- name: Patch the README links to point to the correct files at the current tag
run: |
perl -i.bak -pe 's/\[(.*)\]\((?!http)\.?\/?(.*)\.([a-z]+)\)/[\1](https:\/\/raw.github.com\/idiap\/RawSpeechClassification\/${{ github.event.release.tag_name }}\/\2.\3)/g' README.md
perl -i.bak -pe 's/\[(.*)\]\((?!http)\.?\/?(.*)\)/[\1](https:\/\/github.com\/idiap\/RawSpeechClassification\/tree\/${{ github.event.release.tag_name }}\/\2)/g' README.md
rm README.md.bak
- name: Package the project
run: python -m build
- name: Produce a GitHub actions artifact (the package)
uses: actions/upload-artifact@v4
with:
name: release-dist
path: dist/
if-no-files-found: error
pypi-publish:
name: Upload the release package to PyPI
needs:
- release-packaging
runs-on: ubuntu-22.04
environment:
name: pypi
url: https://pypi.org/p/raw-speech-classification
permissions:
id-token: write # This permission is mandatory for trusted publishing
steps:
- name: Retrieve the package from GitHub actions artifacts
uses: actions/download-artifact@v4
with:
name: release-dist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
github-publish:
name: Upload the release package to GitHub Release
needs:
- release-packaging
runs-on: ubuntu-22.04
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
steps:
- name: Retrieve the package from GitHub actions artifacts
uses: actions/download-artifact@v4
with:
name: release-dist
path: dist
- name: Upload the release package to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
run: gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}'