Skip to content

v1.0.1

v1.0.1 #2

Workflow file for this run

name: Publish releases
on:
release:
types: [released]
env:
PYTHON_VERSION: "3.11"
BASE_IMAGE_VERSION_STABLE: "1.1.2"
BASE_IMAGE_VERSION_BETA: "1.1.2"
jobs:
build-artifact:
name: Builds python artifact uploads to Github Artifact store and PyPi
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.tag }}
steps:
- uses: actions/[email protected]
- name: Get tag
id: vars
run: >-
echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Validate version number
run: >-
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
if ! [[ "${{ steps.vars.outputs.tag }}" =~ "b" || "${{ steps.vars.outputs.tag }}" =~ "rc" ]]; then
echo "Pre-release: Tag is missing beta suffix (${{ steps.vars.outputs.tag }})"
exit 1
fi
else
if [[ "${{ steps.vars.outputs.tag }}" =~ "b" || "${{ steps.vars.outputs.tag }}" =~ "rc" ]]; then
echo "Release: Tag must not have a beta (or rc) suffix (${{ steps.vars.outputs.tag }})"
exit 1
fi
fi
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/[email protected]
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install build
run: >-
pip install build tomli tomli-w
- name: Set Python project version from tag
shell: python
run: |-
import tomli
import tomli_w
with open("pyproject.toml", "rb") as f:
pyproject = tomli.load(f)
pyproject["project"]["version"] = "${{ steps.vars.outputs.tag }}"
with open("pyproject.toml", "wb") as f:
tomli_w.dump(pyproject, f)
- name: Build python package
run: >-
python3 -m build
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
- name: Publish release to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# - name: Create Server + Client repo PR (TODO!)
# uses: music-assistant/frontend-release-pr-action@main
# with:
# github_token: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }}
# new_release_version: ${{ env.version }}