Reimplement synchronized lyrics from clean source #8
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: Build lyrics reimplementation | |
| on: | |
| push: | |
| branches: | |
| - feature/lyrics-reimplementation | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| generate: | |
| if: ${{ !contains(github.event.head_commit.message, '[lyrics-generated]') }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: feature/lyrics-reimplementation | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install native validation tools | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq gettext libglib2.0-bin zip | |
| - name: Install dependencies | |
| run: | | |
| corepack enable | |
| pnpm install --frozen-lockfile --silent | |
| - name: Apply implementation | |
| id: apply | |
| continue-on-error: true | |
| run: python3 scripts/apply_lyrics_reimplementation.py > /tmp/lyrics-apply.log 2>&1 | |
| - uses: actions/upload-artifact@v4 | |
| if: steps.apply.outcome == 'failure' | |
| with: | |
| name: lyrics-apply-error | |
| path: /tmp/lyrics-apply.log | |
| - name: Persist generator failure | |
| if: steps.apply.outcome == 'failure' | |
| run: | | |
| cp /tmp/lyrics-apply.log lyrics-apply-error.txt | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| git add lyrics-apply-error.txt | |
| git commit -m '[lyrics-error] chore: capture generator failure' || true | |
| git push origin HEAD:feature/lyrics-reimplementation || true | |
| cat /tmp/lyrics-apply.log | |
| exit 1 | |
| - name: Update translations | |
| run: | | |
| pnpm run translations | |
| python3 scripts/apply_lyrics_reimplementation.py --translations | |
| - name: Validate | |
| shell: bash | |
| run: | | |
| set -o pipefail | |
| pnpm check 2>&1 | tee /tmp/MediaShell-lyrics-validation.txt | |
| git diff --check | |
| - name: Prepare clean artifacts | |
| run: | | |
| rm -f .github/workflows/lyrics-reimplementation.yml | |
| rm -f scripts/apply_lyrics_reimplementation.py | |
| rm -f lyrics-apply-error.txt | |
| git diff 367fe96f7e89ee18e94a60ab487a631561bbe94f > /tmp/MediaShell-lyrics-reimplementation.patch | |
| zip -qr /tmp/MediaShell-lyrics-reimplementation-source.zip . \ | |
| -x '.git/*' 'node_modules/*' 'dist/*' | |
| cat > /tmp/MediaShell-lyrics-report.md <<'EOF' | |
| # MediaShell synchronized lyrics reimplementation | |
| Built from the clean 2.0.0 source at commit `367fe96f7e89ee18e94a60ab487a631561bbe94f`. | |
| The implementation uses LRCLIB, a bounded session-only cache, cancellable Soup requests, a temporary edge-to-edge lyrics mode, centered synchronized scrolling, plain-lyrics fallback, seek-on-line support, one unified unavailable state, and complete translations for every existing catalog. | |
| No persistent lyrics cache, cache preference, additional validation script, or private GNOME Shell API was added. | |
| EOF | |
| - name: Commit generated source | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| git add -A | |
| git commit -m '[lyrics-generated] feat(popup): add synchronized lyrics' | |
| git push origin HEAD:feature/lyrics-reimplementation | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: MediaShell-lyrics-reimplementation | |
| path: | | |
| /tmp/MediaShell-lyrics-reimplementation-source.zip | |
| /tmp/MediaShell-lyrics-reimplementation.patch | |
| /tmp/MediaShell-lyrics-report.md | |
| /tmp/MediaShell-lyrics-validation.txt | |
| if-no-files-found: error |