fix: flatpak build #35
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 TWLauncher for Windows and Linux | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Cache Electron and builder cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/electron | |
| ~/.cache/electron-builder | |
| node_modules/.cache | |
| key: ${{ runner.os }}-electron-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-electron- | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline | |
| - name: Set author info | |
| run: | | |
| npm pkg set author.name="${{ github.actor }}" | |
| npm pkg set author.email="${{ github.event.pusher.email || 'noreply@github.com' }}" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build/release Electron app (Portable) | |
| run: npm run build:win-portable | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build/release Electron app (Installer) | |
| run: npm run build:win-installer | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: List dist directory | |
| run: dir dist | |
| shell: cmd | |
| - name: Upload portable artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: twlauncher-windows-portable | |
| path: dist/TWLauncher-x64.exe | |
| if-no-files-found: warn | |
| compression-level: 6 | |
| overwrite: false | |
| include-hidden-files: false | |
| - name: Upload installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: twlauncher-windows-installer | |
| path: dist/TWLauncher-Setup.exe | |
| if-no-files-found: warn | |
| compression-level: 6 | |
| overwrite: false | |
| include-hidden-files: false | |
| build-linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Cache Electron and builder cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/electron | |
| ~/.cache/electron-builder | |
| node_modules/.cache | |
| key: ${{ runner.os }}-electron-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-electron- | |
| - name: Install dependencies | |
| run: npm ci --prefer-offline | |
| - name: Install Linux build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| libfuse2 squashfs-tools flatpak flatpak-builder | |
| sudo apt-get remove -y fuse3 || true | |
| sudo apt-get install -y --no-install-recommends fuse | |
| wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /tmp/appimagetool | |
| chmod +x /tmp/appimagetool | |
| sudo mv /tmp/appimagetool /usr/local/bin/appimagetool | |
| flatpak install -y flathub org.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08 | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| - name: Set author info | |
| run: | | |
| npm pkg set author.name="${{ github.actor }}" | |
| npm pkg set author.email="${{ github.event.pusher.email || 'noreply@github.com' }}" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build/release Electron app (AppImage) | |
| run: npm run build:linux-appimage | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build/release Electron app (Installer) | |
| run: npm run build:linux-installer | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Flatpak | |
| run: | | |
| flatpak-builder --force-clean --repo=repo build-dir com.twlauncher.TWLauncher.json | |
| flatpak build-bundle repo dist/TWLauncher.flatpak com.twlauncher.TWLauncher | |
| - name: List dist directory | |
| run: ls -la dist | |
| - name: Upload AppImage artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: twlauncher-linux-appimage | |
| path: dist/*.AppImage | |
| if-no-files-found: error | |
| compression-level: 6 | |
| overwrite: false | |
| include-hidden-files: false | |
| - name: Upload installer artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: twlauncher-linux-installer | |
| path: dist/*.deb | |
| if-no-files-found: warn | |
| compression-level: 6 | |
| overwrite: false | |
| include-hidden-files: false | |
| - name: Upload Flatpak artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: twlauncher-linux-flatpak | |
| path: dist/*.flatpak | |
| if-no-files-found: error | |
| compression-level: 6 | |
| overwrite: false | |
| include-hidden-files: false |