From 9235b47da0ebb5d6b7d7173f3a1c202644efae35 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Tue, 15 Oct 2024 15:59:48 -0300 Subject: [PATCH] electron: Replicate electron artifacts pipeline on flatpak's CI --- .github/workflows/ci.yml | 29 +++++++++++++---------------- package.json | 2 +- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03628d7f4..f3eb3e9c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,7 +78,7 @@ jobs: latestMetadataName: latest-linux.yml - os: ubuntu-24-arm - suffix: linux-arm + suffix: linux arch: arm64 extension: AppImage latestMetadataName: latest-linux-arm64.yml @@ -194,9 +194,13 @@ jobs: include: - os: ubuntu-latest suffix: linux + arch: x86_64 + extension: flatpak - os: ubuntu-24-arm - suffix: linux-arm + suffix: linux + arch: arm64 + extension: flatpak steps: - name: Checkout @@ -216,27 +220,20 @@ jobs: sudo flatpak remote-add --system flathub https://flathub.org/repo/flathub.flatpakrepo flatpak remote-add --user flathub https://flathub.org/repo/flathub.flatpakrepo || true + - name: Set version as environment variable (others) + run: echo "VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> $GITHUB_ENV + - name: Build electron run: | bun install --frozen-lockfile bun run build - env DEBUG="@malept/flatpak-bundler" bun deploy:flatpak - - - name: Build tag name - if: startsWith(github.ref, 'refs/tags/') && success() - run: | - mv dist/Cockpit*.flatpak dist/Cockpit-${{ matrix.suffix }}-$(git describe --tags --abbrev=0).flatpak - - - name: Build name - if: "!startsWith(github.ref, 'refs/tags/') && success()" - run: | - mv dist/Cockpit*.flatpak dist/Cockpit-${{ matrix.suffix }}-$(git describe --tags).flatpak + env DEBUG="@malept/flatpak-bundler" bun run deploy:flatpak - name: Upload Artifact uses: actions/upload-artifact@v3 with: - name: cockpit-${{ matrix.suffix }}-flatpak - path: dist/Cockpit*.flatpak + name: Cockpit-${{ matrix.suffix }}-${{ matrix.arch }}-${{ env.VERSION }}.${{ matrix.extension }} + path: dist/Cockpit*.${{ matrix.extension }} if-no-files-found: error - name: Upload Release @@ -244,7 +241,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') && success() with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: dist/Cockpit*.flatpak + file: dist/Cockpit-${{ matrix.suffix }}-${{ matrix.arch }}-${{ env.VERSION }}.${{ matrix.extension }} tag: ${{ github.ref }} overwrite: true prerelease: true diff --git a/package.json b/package.json index 1c7f6a29e..349c553ec 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "coverage": "vitest --coverage", "deploy:electron:dir": "ELECTRON=true electron-builder --dir", "deploy:electron": "ELECTRON=true electron-builder --publish=never -c.extraMetadata.version=$(git describe --tags --abbrev=0 | sed 's/^v//')", - "deploy:flatpak": "ELECTRON=true electron-builder --x64 --linux flatpak", + "deploy:flatpak": "ELECTRON=true electron-builder --x64 --publish=never --linux flatpak -c.extraMetadata.version=$(git describe --tags --abbrev=0 | sed 's/^v//')", "dev": "vite --host", "dev:electron": "ELECTRON=true vite --host", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore --max-warnings=0",