Skip to content

Commit

Permalink
electron: Replicate electron artifacts pipeline on flatpak's CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl authored and ArturoManzoli committed Oct 15, 2024
1 parent 6e86b4f commit 9235b47
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -216,35 +220,28 @@ 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
uses: svenstaro/upload-release-action@v2
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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9235b47

Please sign in to comment.