Build #7
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 | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-meta: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Generate build metadata | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| BRANCH=${GITHUB_REF_NAME} | |
| COMMIT=${GITHUB_SHA} | |
| echo "{\"branch\":\"${BRANCH}\",\"version\":\"${VERSION}\",\"commit\":\"${COMMIT}\"}" > build-meta.json | |
| cat build-meta.json | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: build-meta | |
| path: build-meta.json | |
| retention-days: 30 | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Read version | |
| run: | | |
| $version = node -p "require('./package.json').version" | |
| echo "VERSION=$version" >> $env:GITHUB_ENV | |
| - run: pnpm run package | |
| - uses: maotoumao/inno-setup-action-cli@main | |
| with: | |
| filepath: ./release/build-windows.iss | |
| variables: /DMyAppVersion=${{ env.VERSION }} /DMyAppId=${{ secrets.MYAPPID }} | |
| - name: Rename setup file | |
| run: | | |
| Rename-Item -Path "./out/MusicFreeSetup.exe" -NewName "MusicFree-${{ env.VERSION }}-win32-x64-setup.exe" | |
| - name: Generate portable | |
| run: | | |
| New-Item -ItemType Directory -Path "./out/MusicFree-win32-x64/portable" -Force | |
| - name: Archive portable | |
| run: | | |
| Compress-Archive -Path "./out/MusicFree-win32-x64/*" -DestinationPath "./out/MusicFree-${{ env.VERSION }}-win32-x64-portable.zip" | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-win32-x64-setup | |
| path: ./out/MusicFree-${{ env.VERSION }}-win32-x64-setup.exe | |
| retention-days: 30 | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-win32-x64-portable | |
| path: ./out/MusicFree-${{ env.VERSION }}-win32-x64-portable.zip | |
| retention-days: 30 | |
| build-windows-legacy: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install | |
| - name: Read version | |
| run: | | |
| $version = node -p "require('./package.json').version" | |
| echo "VERSION=$version" >> $env:GITHUB_ENV | |
| - name: Override Win7 compatibility files | |
| run: | | |
| Get-ChildItem -Recurse -Filter "*.win7.ts" | ForEach-Object { | |
| $target = $_.FullName -replace '\.win7\.ts$', '.ts' | |
| Write-Host "Overriding: $target" | |
| Copy-Item $_.FullName $target -Force | |
| } | |
| - name: Install Electron 22 | |
| run: pnpm add electron@22 --save-dev | |
| - run: pnpm run package | |
| - uses: maotoumao/inno-setup-action-cli@main | |
| with: | |
| filepath: ./release/build-windows.iss | |
| variables: /DMyAppVersion=${{ env.VERSION }} /DMyAppId=${{ secrets.MYAPPID }} | |
| - name: Rename setup file | |
| run: | | |
| Rename-Item -Path "./out/MusicFreeSetup.exe" -NewName "MusicFree-${{ env.VERSION }}-win32-x64-legacy-setup.exe" | |
| - name: Generate portable | |
| run: | | |
| New-Item -ItemType Directory -Path "./out/MusicFree-win32-x64/portable" -Force | |
| - name: Archive portable | |
| run: | | |
| Compress-Archive -Path "./out/MusicFree-win32-x64/*" -DestinationPath "./out/MusicFree-${{ env.VERSION }}-win32-x64-legacy-portable.zip" | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-win32-x64-legacy-setup | |
| path: ./out/MusicFree-${{ env.VERSION }}-win32-x64-legacy-setup.exe | |
| retention-days: 30 | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-win32-x64-legacy-portable | |
| path: ./out/MusicFree-${{ env.VERSION }}-win32-x64-legacy-portable.zip | |
| retention-days: 30 | |
| build-macos-x64: | |
| runs-on: macos-15-intel | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Fix node-gyp for Python 3.12+ | |
| run: python3 -m pip install setuptools --break-system-packages | |
| - run: pnpm install --frozen-lockfile | |
| - name: Read version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - run: pnpm run make | |
| - name: Rename DMG | |
| run: mv "./out/make/MusicFree-${{ env.VERSION }}-x64.dmg" "./out/make/MusicFree-${{ env.VERSION }}-darwin-x64.dmg" | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-darwin-x64 | |
| path: ./out/make/MusicFree-${{ env.VERSION }}-darwin-x64.dmg | |
| retention-days: 30 | |
| build-macos-arm64: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Fix node-gyp for Python 3.12+ | |
| run: python3 -m pip install setuptools --break-system-packages | |
| - run: pnpm install --frozen-lockfile | |
| - name: Read version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - run: pnpm run make -- --arch=arm64 | |
| - name: Rename DMG | |
| run: mv "./out/make/MusicFree-${{ env.VERSION }}-arm64.dmg" "./out/make/MusicFree-${{ env.VERSION }}-darwin-arm64.dmg" | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-darwin-arm64 | |
| path: ./out/make/MusicFree-${{ env.VERSION }}-darwin-arm64.dmg | |
| retention-days: 30 | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y rpm | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - name: Read version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - run: pnpm run make | |
| - name: Rename DEB | |
| run: | | |
| DEB_FILE=$(find ./out/make/deb/x64/ -name "*.deb" | head -1) | |
| if [ -n "$DEB_FILE" ]; then | |
| mv "$DEB_FILE" "./out/make/deb/x64/MusicFree-${{ env.VERSION }}-linux-amd64.deb" | |
| fi | |
| - name: Rename RPM | |
| run: | | |
| RPM_FILE=$(find ./out/make/rpm/x64/ -name "*.rpm" | head -1) | |
| if [ -n "$RPM_FILE" ]; then | |
| mv "$RPM_FILE" "./out/make/rpm/x64/MusicFree-${{ env.VERSION }}-linux-amd64.rpm" | |
| fi | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-linux-amd64-deb | |
| path: ./out/make/deb/x64/MusicFree-${{ env.VERSION }}-linux-amd64.deb | |
| retention-days: 30 | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: MusicFree-${{ env.VERSION }}-linux-amd64-rpm | |
| path: ./out/make/rpm/x64/MusicFree-${{ env.VERSION }}-linux-amd64.rpm | |
| retention-days: 30 |