Merge branch 'feat-2812' #10
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: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| contents: write | |
| env: | |
| IS_CI: 'true' | |
| jobs: | |
| Windows: | |
| name: Windows | |
| runs-on: windows-latest | |
| steps: | |
| - name: Check out git repository | |
| uses: actions/checkout@v6 | |
| - name: Get npm cache directory | |
| shell: pwsh | |
| run: echo "NPM_CACHE=$(npm config get cache)" >> $env:GITHUB_ENV | |
| - name: Show Env | |
| run: echo "${{ env.NPM_CACHE }}" | |
| - name: Setup Node Env | |
| env: | |
| NPM_CACHE: ${{ env.NPM_CACHE }} | |
| uses: ./.github/actions/setup | |
| - name: Build src code | |
| run: | | |
| git status --porcelain | |
| npm run build | |
| - name: Build Package Setup x64 | |
| run: npm run pack:win:setup:x64 | |
| - name: Upload Artifact Setup x64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-x64-Setup | |
| path: build/*-x64-Setup.exe | |
| - name: Build Package 7z x64 | |
| run: npm run pack:win:7z:x64 | |
| - name: Upload Artifact 7z x64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-win_x64-green | |
| path: build/*win_x64-green.7z | |
| - name: Build Package Setup arm64 | |
| run: npm run pack:win:setup:arm64 | |
| - name: Upload Artifact Setup arm64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-arm64-Setup | |
| path: build/*-arm64-Setup.exe | |
| - name: Build Package 7z arm64 | |
| run: npm run pack:win:7z:arm64 | |
| - name: Upload Artifact 7z arm64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-win_arm64-green | |
| path: build/*win_arm64-green.7z | |
| - name: Generate file MD5 | |
| run: | | |
| cd build | |
| Get-FileHash *.exe,*.7z -Algorithm MD5 | Format-List | |
| Windows_7: | |
| name: Windows_7 | |
| runs-on: windows-latest | |
| env: | |
| BUILD_WIN7: true | |
| steps: | |
| - name: Check out git repository | |
| uses: actions/checkout@v6 | |
| - name: Get npm cache directory | |
| shell: pwsh | |
| run: echo "NPM_CACHE=$(npm config get cache)" >> $env:GITHUB_ENV | |
| - name: Setup Node Env | |
| env: | |
| NPM_CACHE: ${{ env.NPM_CACHE }} | |
| uses: ./.github/actions/setup | |
| - name: Prepare win7 undici env | |
| run: | | |
| npm install undici@5 | |
| Set-Content -Path .\src\common\utils\request.ts -Value "export * from './request_node16'" | |
| - name: Build src code | |
| env: | |
| BUILD_WIN7: true | |
| run: | | |
| git status --porcelain | |
| npm run build | |
| - name: Prepare win7 electron env | |
| run: | | |
| npm install electron@22 | |
| pip.exe install setuptools | |
| - name: Build Package win7 Setup x64 | |
| run: npm run pack:win7:setup:x64 | |
| - name: Upload Artifact win7 Setup x64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-win7_x64-Setup | |
| path: build/*win7_x64-Setup.exe | |
| - name: Build Package win7 7z x64 | |
| run: npm run pack:win7:7z:x64 | |
| - name: Upload Artifact win7 7z x64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-win7_x64-green | |
| path: build/*win7_x64-green.7z | |
| - name: Build Package win7 7z x86 | |
| run: npm run pack:win7:7z:x86 | |
| - name: Upload Artifact win7 7z x86 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-win7_x86-green | |
| path: build/*win7_x86-green.7z | |
| - name: Generate file MD5 | |
| run: | | |
| cd build | |
| Get-FileHash *.exe,*.7z -Algorithm MD5 | Format-List | |
| Mac: | |
| name: Mac | |
| runs-on: macos-latest | |
| steps: | |
| - name: Check out git repository | |
| uses: actions/checkout@v6 | |
| - name: Install python3 setuptools | |
| run: brew install python-setuptools | |
| - name: Get npm cache directory | |
| shell: bash | |
| run: echo "NPM_CACHE=$(npm config get cache)" >> $GITHUB_ENV | |
| - name: Show Env | |
| run: echo "${{ env.NPM_CACHE }}" | |
| - name: Setup Node Env | |
| env: | |
| NPM_CACHE: ${{ env.NPM_CACHE }} | |
| uses: ./.github/actions/setup | |
| - name: Build src code | |
| run: | | |
| git status --porcelain | |
| npm run build | |
| - name: Build Package dmg | |
| run: | | |
| npm run pack:mac:dmg | |
| npm run pack:mac:dmg:arm64 | |
| - name: Upload Artifact dmg | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-mac-dmg | |
| path: | | |
| build/*.dmg | |
| !build/*-arm64.dmg | |
| - name: Upload Artifact dmg arm64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-mac-dmg-arm64 | |
| path: build/*-arm64.dmg | |
| - name: Generate file MD5 | |
| run: | | |
| cd build | |
| md5 *.dmg | |
| Linux: | |
| name: Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install package | |
| run: sudo apt-get update && sudo apt-get install -y rpm libarchive-tools | |
| - name: Check out git repository | |
| uses: actions/checkout@v6 | |
| - name: Get npm cache directory | |
| shell: bash | |
| run: echo "NPM_CACHE=$(npm config get cache)" >> $GITHUB_ENV | |
| - name: Show Env | |
| run: echo "${{ env.NPM_CACHE }}" | |
| - name: Setup Node Env | |
| env: | |
| NPM_CACHE: ${{ env.NPM_CACHE }} | |
| uses: ./.github/actions/setup | |
| - name: Build src code | |
| run: | | |
| git status --porcelain | |
| npm run build | |
| - name: Build Package deb amd64 | |
| run: npm run pack:linux:deb:amd64 | |
| - name: Upload Artifact deb amd64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-deb-amd64 | |
| path: build/*_amd64.deb | |
| - name: Build Package deb arm64 | |
| run: npm run pack:linux:deb:arm64 | |
| - name: Upload Artifact deb arm64 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-deb-arm64 | |
| path: build/*_arm64.deb | |
| - name: Build Package deb armv7l | |
| run: npm run pack:linux:deb:armv7l | |
| - name: Upload Artifact deb armv7l | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-deb-armv7l | |
| path: build/*_armv7l.deb | |
| - name: Build Package x64 appImage | |
| run: npm run pack:linux:appImage | |
| - name: Upload Artifact x64 appImage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-x64-appImage | |
| path: build/*_x64.AppImage | |
| - name: Build Package x64 rpm | |
| run: npm run pack:linux:rpm | |
| - name: Upload Artifact x64 rpm | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-x64-rpm | |
| path: build/*.x64.rpm | |
| - name: Build Package x64 pacman | |
| run: npm run pack:linux:pacman | |
| - name: Upload Artifact x64 pacman | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: lx-music-desktop-x64-pacman | |
| path: build/*_x64.pacman | |
| - name: Generate file MD5 | |
| run: | | |
| cd build | |
| md5sum *.deb *.rpm *.pacman *.AppImage | |
| Release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - Windows | |
| - Windows_7 | |
| - Mac | |
| - Linux | |
| steps: | |
| - name: Check out git repository | |
| uses: actions/checkout@v6 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release-artifacts | |
| - name: Read version from package.json | |
| id: version | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "tag=v$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Flatten artifacts | |
| run: | | |
| mkdir -p release-files | |
| find release-artifacts -type f -exec cp {} release-files/ \; | |
| ls -la release-files | |
| - name: Delete duplicated draft release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| gh release list --json tagName,isDraft,name | \ | |
| jq -r '.[] | select(.isDraft == true and .name == "${{ steps.version.outputs.version }}") | .tagName' | \ | |
| while read -r TAG_NAME; do | |
| if [ -n "$TAG_NAME" ]; then | |
| gh release delete "$TAG_NAME" --cleanup-tag --yes || true | |
| fi | |
| done | |
| - name: Create or update tag | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if gh release view "${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then | |
| echo "Release already exists for ${{ steps.version.outputs.tag }}" | |
| else | |
| if git rev-parse "${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then | |
| echo "Tag ${{ steps.version.outputs.tag }} already exists" | |
| else | |
| git tag "${{ steps.version.outputs.tag }}" | |
| git push origin "${{ steps.version.outputs.tag }}" | |
| fi | |
| fi | |
| - name: Create or update GitHub release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| if gh release view "${{ steps.version.outputs.tag }}" >/dev/null 2>&1; then | |
| gh release upload "${{ steps.version.outputs.tag }}" release-files/* --clobber | |
| else | |
| gh release create "${{ steps.version.outputs.tag }}" release-files/* \ | |
| --title "${{ steps.version.outputs.version }}" \ | |
| --notes "" | |
| fi |