fix(music): «волна»/«избранное» не работали для трека Станции (alpha.81) #81
Workflow file for this run
This file contains hidden or 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: Release | |
| # Триггер: push тега v* (например, v0.1.0). Создаёт GitHub Release и пушит | |
| # multi-arch Docker-образ в GitHub Container Registry (ghcr.io). | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| docker: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-qemu-action@v3 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=ref,event=branch | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| # Multi-arch image для Docker Compose / standalone-инсталляций. | |
| - uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # Архитектурно-разделённые образы для HA Add-on. Supervisor подставляет | |
| # {arch} в image name из config.yaml — поэтому нужны отдельные тэги | |
| # ghcr.io/ivkaiv/amd64-homeglance и ghcr.io/ivkaiv/aarch64-homeglance. | |
| - id: addon-meta-amd64 | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/amd64-homeglance | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/amd64 | |
| push: true | |
| tags: ${{ steps.addon-meta-amd64.outputs.tags }} | |
| labels: ${{ steps.addon-meta-amd64.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - id: addon-meta-aarch64 | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/aarch64-homeglance | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| platforms: linux/arm64 | |
| push: true | |
| tags: ${{ steps.addon-meta-aarch64.outputs.tags }} | |
| labels: ${{ steps.addon-meta-aarch64.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: docker | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract changelog for tag | |
| id: changelog | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| VERSION="${TAG#v}" | |
| # Достаём секцию релиза из CHANGELOG.md между [VERSION] и следующим заголовком версии. | |
| NOTES=$(awk -v v="$VERSION" ' | |
| $0 ~ "^## \\[" v "\\]" { found=1; next } | |
| found && /^## \[/ { exit } | |
| found { print } | |
| ' CHANGELOG.md) | |
| { | |
| echo 'notes<<EOF' | |
| echo "${NOTES:-Release $TAG}" | |
| echo 'EOF' | |
| } >> "$GITHUB_OUTPUT" | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| body: ${{ steps.changelog.outputs.notes }} | |
| draft: false | |
| prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }} | |
| hacs-asset: | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Attach HACS plugin to release | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| gh release upload "$TAG" \ | |
| homeglance.js \ | |
| hacs.json \ | |
| --clobber | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |