[TECH] Refactor package.json, electron builder and others #3698
This file contains 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: Linux Flatpak and Tar.xz builds | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Build Flatpak Files' | |
required: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | |
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} | |
RUDDERSTACK_CLIENT_ID: ${{ secrets.RUDDERSTACK_CLIENT_ID }} | |
jobs: | |
flatpak: | |
name: 'Flatpak Build' | |
runs-on: ubuntu-latest-8core | |
concurrency: | |
group: flatpak-${{ github.ref }} | |
cancel-in-progress: true | |
container: | |
image: bilelmoussaoui/flatpak-github-actions:freedesktop-23.08 | |
options: --privileged | |
steps: | |
- name: install libnss, libatk, libatk-bridge, libcups, libgtk-3 | |
run: dnf install nss-tools atk-devel at-spi2-atk-devel cups-devel gtk3-devel make automake gcc gcc-c++ g++ python3 python3-pip -y | |
- name: Checkout Repo | |
uses: actions/checkout@v4 | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- uses: pnpm/action-setup@v3 | |
with: | |
standalone: ${{ runner.os == 'Windows' }} | |
- name: Install node-gyp | |
run: pnpm add --global node-gyp | |
shell: bash | |
- name: install python setuptools | |
run: pip3 install setuptools | |
- name: Reconfigure git to use HTTP authentication | |
run: > | |
git config --global url."https://github.com/".insteadOf | |
ssh://[email protected]/ | |
- name: Authenticate with private NPM package | |
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
- name: setup env production file | |
run: | | |
echo "VITE_LD_ENVIRONMENT_ID=${{ secrets.VITE_LD_ENVIRONMENT_ID }}" > .env.production | |
echo "VITE_IPFS_API=${{ secrets.VITE_IPFS_API }}" >> .env.production | |
- name: Install modules. | |
run: pnpm run setup | |
- name: Build artifacts. | |
run: pnpm run dist:linux:ci:flatpak | |
- name: Clean up build files to save space | |
run: rm -rf build dist/linux-unpacked node_modules public/bin/win32 public/bin/darwin ~/.cache | |
- name: Prepare Flatpak | |
run: pnpm flatpak:prepare | |
- name: Build Flatpak | |
uses: flatpak/flatpak-github-actions/flatpak-builder@v6 | |
with: | |
bundle: hyperplay.flatpak | |
manifest-path: flatpak-build/xyz.hyperplay.HyperPlay.yml | |
cache-key: flatpak-builder-${{ github.sha }} | |
- name: Upload tar xz | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux-tar-xz | |
path: dist/hyperplay*.tar.xz | |
retention-days: 14 | |
if-no-files-found: error | |
compression-level: 3 |