2.10.9 #137
Workflow file for this run
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: Publish releases | |
on: | |
release: | |
types: [published] | |
env: | |
PYTHON_VERSION: "3.10" | |
NODE_VERSION: "18.x" | |
NODE_OPTIONS: --max_old_space_size=6144 | |
# Set default workflow permissions | |
# All scopes not mentioned here are set to no access | |
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token | |
permissions: | |
actions: none | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.vars.outputs.tag }} | |
permissions: | |
contents: write # Required to upload release assets | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Get tag | |
id: vars | |
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Set up Python ${{ env.PYTHON_VERSION }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Set up Node ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache: yarn | |
- name: Install dependencies | |
run: | | |
yarn install | |
python3 -m 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 and release package | |
run: | | |
yarn build | |
rm -rf dist music_assistant_frontend.egg-info | |
python3 -m build | |
- name: Publish release to PyPI | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
- name: Upload release assets | |
uses: softprops/[email protected] | |
with: | |
files: | | |
dist/*.whl | |
dist/*.tar.gz | |
server-repo-pr: | |
name: Server repo PR | |
needs: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: music-assistant/frontend-release-pr-action@main | |
with: | |
github_token: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }} | |
new_release_version: ${{ needs.release.outputs.version }} |