Skip to content

⬆ Update snapcast version #266

⬆ Update snapcast version

⬆ Update snapcast version #266

Workflow file for this run

---
name: Build package & publish
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- "**" # Push events on all branchs
tags:
- v* # Push events with tags starting with v
jobs:
publish:
name: Build package
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "18.x"
- name: Install node requirements
run: npm ci
- name: 🚨 Check lint
run: |
npm run lint
- name: 🏗 Build html
run: make build
env:
BASE_PATH: /muse
- name: 🚀 Deploy to GitHub pages
if: startsWith(github.event.ref, 'refs/tags') || github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./build
force_orphan: true
- name: 🐍 Build Python package
run: make build-python
- name: Publish package 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
repository-url: https://test.pypi.org/legacy/
- name: Publish package 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.pypi_password }}
repository-url: https://upload.pypi.org/legacy/
- name: 🐳 Docker metadata
id: meta
uses: docker/metadata-action@v4
if: startsWith(github.event.ref, 'refs/tags')
with:
images: cristianpb/mopidy-muse
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
if: startsWith(github.event.ref, 'refs/tags')
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
if: startsWith(github.event.ref, 'refs/tags')
- name: Login to DockerHub
uses: docker/login-action@v2
if: startsWith(github.event.ref, 'refs/tags')
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: prod
build-args: |
app_path=/muse
- name: Build and push docker image
uses: docker/build-push-action@v5
if: startsWith(github.event.ref, 'refs/tags')
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: prod
build-args: |
app_path=/muse
- name: 🍱 Upload package artifact
uses: actions/upload-artifact@v4
with:
name: Mopidy-Muse.zip
path: dist/Mopidy-Muse*.tar.gz
- name: ⬆ Upgrade package version files
if: startsWith(github.event.ref, 'refs/tags')
run: |
git config --global user.name 'Github Bot'
git config --global user.email 'bot@github.com'
git add package.json package-lock.json pyproject.toml
git commit -m "⬆ Upgrade package version files"
git push origin HEAD:master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
releasing:
name: Publish release
needs: publish
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: ⬇ Download artifact from build package job
uses: actions/download-artifact@v4
with:
name: Mopidy-Muse.zip
- run: mv Mopidy-Muse*.tar.gz Mopidy-Muse.tar.gz
- name: 🔖Publish Release
uses: softprops/action-gh-release@v1
with:
files: ./Mopidy-Muse.tar.gz
name: Release ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}