Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

electron: Replicate electron artifacts pipeline on flatpak's CI #1408

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading