Skip to content

Commit

Permalink
Merge branch 'music-assistant:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gieljnssns authored Jan 27, 2024
2 parents 17c7f51 + ff6acc9 commit 29a8738
Show file tree
Hide file tree
Showing 200 changed files with 13,610 additions and 7,648 deletions.
25 changes: 22 additions & 3 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
change-template: '- #$NUMBER - $TITLE (@$AUTHOR)'
categories:
- title: "⬆️ Dependencies"
- title: "⚠ Breaking Changes"
labels:
- 'breaking-change'
- title: '⬆️ Dependencies'
collapse-after: 1
labels:
- "dependencies"
- 'dependencies'
- 'ci'
template: |
## What's Changed
## What’s Changed
$CHANGES
version-resolver:
major:
labels:
- 'breaking-change'
minor:
labels:
- 'new-feature'
- 'new-provider'
- 'enhancement'
- 'refactor'
default: patch
76 changes: 0 additions & 76 deletions .github/workflows/docker-build.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/pr-labels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: PR Labels

# yamllint disable-line rule:truthy
on:
pull_request:
types:
- synchronize
- labeled
- unlabeled
branches:
- main

jobs:
pr_labels:
name: Verify
runs-on: ubuntu-latest
steps:
- name: 🏷 Verify PR has a valid label
uses: ludeeus/[email protected]
with:
labels: >-
breaking-change, bugfix, refactor, new-feature, maintenance, ci, dependencies, new-provider
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ jobs:
auto-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4.6.1
uses: actions/setup-python@v5.0.0
with:
python-version: '3.10'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit autoupdate
run: pre-commit autoupdate
- name: Create Pull Request
uses: peter-evans/[email protected].1
uses: peter-evans/[email protected].2
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-autoupdate
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/publish-to-pypi.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v5.25.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124 changes: 124 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Publish releases

on:
release:
types: [published]

jobs:
build-and-publish-pypi:
name: Builds and publishes releases to PyPI
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.tag }}
steps:
- uses: actions/checkout@v4
- name: Get tag
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set up Python 3.10
uses: actions/[email protected]
with:
python-version: "3.10"
- 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
run: >-
python3 -m build
- name: Publish release to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

build-and-push-container-image:
name: Builds and pushes the Music Assistant Server container to ghcr.io
runs-on: ubuntu-latest
permissions:
packages: write
needs: build-and-publish-pypi
steps:
- name: Sleep for 60 seconds (to prevent race condition with the pypi upload)
run: sleep 60s
shell: bash
- uses: actions/checkout@v4
- name: Log in to the GitHub container registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Version number for tags
id: tags
shell: bash
run: |-
patch=${GITHUB_REF#refs/*/}
echo "patch=${patch}" >> $GITHUB_OUTPUT
echo "minor=${patch%.*}" >> $GITHUB_OUTPUT
echo "major=${patch%.*.*}" >> $GITHUB_OUTPUT
if [[ $patch =~ "b" ]]; then
echo "channel=beta" >> $GITHUB_OUTPUT
else
echo "channel=stable" >> $GITHUB_OUTPUT
fi
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository_owner }}/server
- name: Build and Push images
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
tags: |-
ghcr.io/${{ github.repository_owner }}/server:${{ steps.tags.outputs.patch }},
ghcr.io/${{ github.repository_owner }}/server:${{ steps.tags.outputs.minor }},
ghcr.io/${{ github.repository_owner }}/server:${{ steps.tags.outputs.major }},
ghcr.io/${{ github.repository_owner }}/server:${{ steps.tags.outputs.channel }},
ghcr.io/${{ github.repository_owner }}/server:latest
push: true
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"MASS_VERSION=${{ needs.build-and-publish-pypi.outputs.version }}"
release-notes-update:
name: Updates the release notes and changelog
needs: [ build-and-publish-pypi, build-and-push-container-image ]
runs-on: ubuntu-latest
steps:
- name: Update changelog and release notes including frontend notes
uses: music-assistant/release-notes-merge-action@main
with:
github_token: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }}
release_tag: ${{ needs.build-and-publish-pypi.outputs.version }}

addon-version-update:
name: Updates the Addon repository with the new version
needs: [ build-and-publish-pypi, build-and-push-container-image, release-notes-update ]
runs-on: ubuntu-latest
steps:
- name: Push new version number to addon config
uses: music-assistant/addon-update-action@main
with:
github_token: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }}
new_server_version: ${{ needs.build-and-publish-pypi.outputs.version }}
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ jobs:

steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4.6.1
uses: actions/setup-python@v5.0.0
with:
python-version: "3.11"
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
python -m pip install --upgrade pip build setuptools
pip install . .[test]
- name: Lint/test with pre-commit
Expand All @@ -39,9 +41,9 @@ jobs:

steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.6.1
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
Expand All @@ -10,18 +10,18 @@ repos:
- --branch=main
- id: debug-statements
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.270'
rev: 'v0.1.14'
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.1.0
hooks:
- id: black
args:
- --safe
- --quiet
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.6
hooks:
- id: codespell
args: []
Expand Down
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
},
"python.formatting.provider": "black",
Expand Down
Loading

0 comments on commit 29a8738

Please sign in to comment.