name: Build and Release on: push: tags: - 'v*' permissions: contents: write jobs: build: strategy: fail-fast: false matrix: include: - name: win-x64 os: windows-latest target: win32-x64 - name: linux-x64 os: ubuntu-latest target: linux-x64 - name: linux-arm64 os: ubuntu-24.04-arm target: linux-arm64 runs-on: ${{ matrix.os }} steps: - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup pnpm uses: pnpm/action-setup@v4 with: version: 10.28.0 run_install: false - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '22' cache: 'pnpm' - name: Install dependencies run: pnpm install --frozen-lockfile # Always builds the WebUI flavor — no separate "core-only" artifact. - name: Build project env: SNOWLUMA_TARGET: ${{ matrix.target }} run: pnpm run build:all - name: Bundle runtime dependencies working-directory: dist run: npm install --omit=dev # Naming convention: # SnowLuma--.zip|tar.gz – zero-install (node bundled) # SnowLuma---lite.zip|tar.gz – user provides Node >= 22 - name: Package (windows) if: matrix.os == 'windows-latest' shell: pwsh run: | Compress-Archive -Path "dist\*" -DestinationPath "SnowLuma-${{ github.ref_name }}-${{ matrix.name }}-lite.zip" Copy-Item (Get-Command node).Source -Destination "dist\node.exe" Compress-Archive -Path "dist\*" -DestinationPath "SnowLuma-${{ github.ref_name }}-${{ matrix.name }}.zip" - name: Package (linux) if: startsWith(matrix.os, 'ubuntu') run: | chmod +x dist/launcher.sh tar -czf "SnowLuma-${{ github.ref_name }}-${{ matrix.name }}-lite.tar.gz" -C dist . cp "$(command -v node)" dist/node chmod +x dist/node tar -czf "SnowLuma-${{ github.ref_name }}-${{ matrix.name }}.tar.gz" -C dist . - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: release-${{ matrix.name }} path: SnowLuma-${{ github.ref_name }}-${{ matrix.name }}* if-no-files-found: error retention-days: 1 release: needs: build runs-on: ubuntu-latest steps: - name: Checkout (for git log) uses: actions/checkout@v4 with: fetch-depth: 0 - name: Download all artifacts uses: actions/download-artifact@v4 with: path: artifacts - name: Collect release assets run: | mkdir -p release find artifacts -type f \( -name '*.zip' -o -name '*.tar.gz' \) -exec cp {} release/ \; ls -lh release/ - name: Generate release note shell: bash run: | tag="${GITHUB_REF_NAME}" previousTag="$(git describe --tags --abbrev=0 "${tag}^" 2>/dev/null || true)" if [[ -n "$previousTag" ]]; then changes="$(git log --pretty=format:'- %s (%h)' "$previousTag..$tag")" else changes="$(git log --pretty=format:'- %s (%h)' "$tag")" fi [[ -z "$changes" ]] && changes="- No commit changes detected." cat > release-notes.md <