forked from music-assistant/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'music-assistant:main' into main
- Loading branch information
Showing
55 changed files
with
2,157 additions
and
1,306 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ name: Publish releases | |
on: | ||
release: | ||
types: [published] | ||
env: | ||
PYTHON_VERSION: "3.11" | ||
|
||
jobs: | ||
build-and-publish-pypi: | ||
|
@@ -11,14 +13,27 @@ jobs: | |
outputs: | ||
version: ${{ steps.vars.outputs.tag }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4.1.4 | ||
- name: Get tag | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: Set up Python 3.11 | ||
- name: Validate version number | ||
run: >- | ||
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then | ||
if ! [[ "${{ steps.vars.outputs.tag }}" =~ "b" ]]; then | ||
echo "Pre-release: Tag is missing beta suffix (${{ steps.vars.outputs.tag }})" | ||
exit 1 | ||
fi | ||
else | ||
if [[ "${{ steps.vars.outputs.tag }}" =~ "b" ]]; then | ||
echo "Release: Tag must not have a beta suffix (${{ steps.vars.outputs.tag }})" | ||
exit 1 | ||
fi | ||
fi | ||
- name: Set up Python ${{ env.PYTHON_VERSION }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: "3.11" | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- name: Install build | ||
run: >- | ||
pip install build tomli tomli-w | ||
|
@@ -35,7 +50,7 @@ jobs: | |
with open("pyproject.toml", "wb") as f: | ||
tomli_w.dump(pyproject, f) | ||
- name: Build | ||
- name: Build python package | ||
run: >- | ||
python3 -m build | ||
- name: Publish release to PyPI | ||
|
@@ -53,7 +68,7 @@ jobs: | |
packages: write | ||
needs: build-and-publish-pypi | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4.1.4 | ||
- name: Log in to the GitHub container registry | ||
uses: docker/[email protected] | ||
with: | ||
|
@@ -70,21 +85,9 @@ jobs: | |
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 | ||
- name: Build and Push release | ||
uses: docker/[email protected] | ||
if: github.event.release.prerelease == false | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
|
@@ -93,31 +96,47 @@ jobs: | |
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 | ||
ghcr.io/${{ github.repository_owner }}/server:stable | ||
push: true | ||
build-args: "MASS_VERSION=${{ needs.build-and-publish-pypi.outputs.version }}" | ||
- name: Build and Push pre-release | ||
uses: docker/[email protected] | ||
if: github.event.release.prerelease == true | ||
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:beta | ||
push: true | ||
labels: ${{ steps.meta.outputs.labels }} | ||
build-args: | | ||
"MASS_VERSION=${{ needs.build-and-publish-pypi.outputs.version }}" | ||
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 ] | ||
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 | ||
if: github.event.release.prerelease == true | ||
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 ] | ||
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 | ||
if: github.event.release.prerelease == true | ||
with: | ||
github_token: ${{ secrets.PRIVILEGED_GITHUB_TOKEN }} | ||
new_server_version: ${{ needs.build-and-publish-pypi.outputs.version }} |
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
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
Oops, something went wrong.