Skip to content

Commit

Permalink
#559 package to snap, tar.gz and portable (#560)
Browse files Browse the repository at this point in the history
* package: portable, tarball, flatpak, snap

* update version

* package workflow

* husky and ts-node

* package workflow

* flatpak support in package and multi arch

* fix-missing

* remove arch

* remove flatpak
  • Loading branch information
danielfebrero authored Oct 1, 2024
1 parent c5cc5ce commit fbb3dc5
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 104 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: push

jobs:
deps:
name: Setup and get deps
name: Setup, Test, and Package
runs-on: ${{ matrix.os }}

strategy:
Expand Down Expand Up @@ -36,31 +36,38 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm install -g ts-node \
npm exec electron-builder build --publish=never
- if: matrix.os == 'ubuntu-latest'
name: Ubuntu release
name: Ubuntu artifacts upload
uses: actions/upload-artifact@v4
with:
name: BonBon-linux
path: |
release/build/*-latest.yml
release/build/BonBon-*.*.*.snap
release/build/BonBon-*.*.*.flatpak
release/build/BonBon-*.*.*.tar.gz
release/build/BonBon-*.*.*.AppImage
release/build/BonBon-*.*.*.deb
release/build/BonBon-*.*.*.rpm
- if: matrix.os == 'macos-latest'
name: MacOS release
name: MacOS artifacts upload
uses: actions/upload-artifact@v4
with:
name: BonBon-macos
path: |
release/build/*-latest.yml
release/build/BonBon-*.*.*-arm64.dmg
release/build/BonBon-*.*.*.dmg
- if: matrix.os == 'windows-latest'
name: Windows release
name: Windows artifacts upload
uses: actions/upload-artifact@v4
with:
name: BonBon-windows
path: |
release/build/*-latest.yml
release/build/BonBon Setup *.*.*.exe
release/build/BonBon-*.*.*.exe
116 changes: 59 additions & 57 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
release:
types:
- created
workflow_dispatch:

jobs:
checkVersions:
Expand All @@ -18,12 +19,6 @@ jobs:
- name: Get dependencies
run: pip3 install semver

# Add your custom version check script here
# - name: Compare tag version and internal version
# env:
# TAG: ${{ github.ref }}
# run: python3 ./.github/compare_versions.py

release:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -43,89 +38,77 @@ jobs:
- name: Install dependencies
run: npm ci --legacy-peer-deps

# TypeScript check
# - name: Check types
# run: npm exec tsc

# Run ESLint for code linting
# - name: Run ESLint
# run: npm run lint

# Compile the app
- name: Compile
run: npm run build

# Run tests
# - name: Run tests
# run: npm run test

# Package the app without publishing
- name: Package
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm exec electron-builder build --publish=never

# macOS notarization (if applicable)
- name: Notarize app for macOS
if: matrix.os == 'macos-latest'
# Build and package for Flatpak
- if: matrix.os == 'ubuntu-latest'
name: Build Flatpak package
run: |
set -e
xcrun altool --notarize-app --primary-bundle-id "org.erb.BonBon" --username "$APPLE_ID" --password "$APPLE_ID_PASSWORD" --file release/build/BonBon-*.*.*.dmg | tee notarization_log.txt
xcrun stapler staple release/build/BonBon-*.*.*.dmg | tee -a notarization_log.txt
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
continue-on-error: true

- name: Verify macOS notarization
if: matrix.os == 'macos-latest'
run: xcrun stapler validate release/build/BonBon-*.*.*.dmg
continue-on-error: true
npm exec electron-builder --linux flatpak
# Linux releases (AppImage and Flatpak)
# Upload the Flatpak package
- if: matrix.os == 'ubuntu-latest'
name: Linux AppImage release
uses: svenstaro/upload-release-action@2.3.0
name: Upload Flatpak
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
file: release/build/BonBon-*.*.*.AppImage
file: release/build/BonBon-*.*.*.flatpak
tag: ${{ github.ref }}
continue-on-error: true

# Packaging for Linux (Snap)
- if: matrix.os == 'ubuntu-latest'
name: latest.yml release for Linux
uses: svenstaro/[email protected]
name: Build Snap package
run: |
sudo apt-get update
sudo apt-get install snapcraft -y
snapcraft
- if: matrix.os == 'ubuntu-latest'
name: Upload Snap package
uses: svenstaro/upload-release-action@v2
with:
file_glob: true
file: release/build/*-latest.yml
file: release/build/BonBon-*.*.*.snap
tag: ${{ github.ref }}
continue-on-error: true

# macOS releases (Intel and ARM64)
- if: matrix.os == 'macos-latest'
name: macOS arm64 release
# Linux AppImage release
- if: matrix.os == 'ubuntu-latest'
name: Linux AppImage release
uses: svenstaro/[email protected]
with:
file_glob: true
file: release/build/BonBon-*.*.*-arm64.dmg
file: release/build/BonBon-*.*.*.AppImage
tag: ${{ github.ref }}
continue-on-error: true

- if: matrix.os == 'macos-latest'
name: macOS intel release
# Packaging for Linux tar.gz
- if: matrix.os == 'ubuntu-latest'
name: Build Linux Tarball
run: npm exec electron-builder --linux tar.gz

- if: matrix.os == 'ubuntu-latest'
name: Upload Linux Tarball
uses: svenstaro/[email protected]
with:
file_glob: true
file: release/build/BonBon-*.*.*.dmg
file: release/build/*.tar.gz
tag: ${{ github.ref }}
continue-on-error: true

- if: matrix.os == 'macos-latest'
name: latest.yml release for macOS
# Windows Portable release
- if: matrix.os == 'windows-latest'
name: Build Windows Portable
run: npm exec electron-builder --win portable

- if: matrix.os == 'windows-latest'
name: Upload Windows Portable
uses: svenstaro/[email protected]
with:
file_glob: true
file: release/build/*-latest.yml
file: release/build/*.exe
tag: ${{ github.ref }}
continue-on-error: true

Expand All @@ -147,3 +130,22 @@ jobs:
file: release/build/BonBon Setup *.*.*.exe
tag: ${{ github.ref }}
continue-on-error: true

# macOS releases
# - if: matrix.os == 'macos-latest'
# name: macOS arm64 release
# uses: svenstaro/[email protected]
# with:
# file_glob: true
# file: release/build/BonBon-*.*.*-arm64.dmg
# tag: ${{ github.ref }}
# continue-on-error: true

- if: matrix.os == 'macos-latest'
name: macOS intel release
uses: svenstaro/[email protected]
with:
file_glob: true
file: release/build/BonBon-*.*.*.dmg
tag: ${{ github.ref }}
continue-on-error: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

### 🚀 Download

Download the latest version BonBon for Windows (setup and portable)/macOS intel/macOS arm/Linux (AppImage): [1.0.5](https://github.com/BonBon-exchange/bonbon-browser/releases/latest)
Download the latest version BonBon for Windows (setup and portable)/macOS universal/Linux (AppImage, Snap, Flatpak, tar.gz): [1.0.6](https://github.com/BonBon-exchange/bonbon-browser/releases/latest)

<p align="right">(<a href="#top">back to top</a>)</p>

Expand Down
42 changes: 4 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"typescript",
"react"
],
"version": "1.0.5",
"version": "1.0.6",
"homepage": "https://github.com/BonBon-exchange/bonbon-browser#readme",
"bugs": {
"url": "https://github.com/BonBon-exchange/bonbon-browser/issues"
Expand Down Expand Up @@ -298,7 +298,9 @@
"target": [
"AppImage",
"deb",
"rpm"
"rpm",
"tar.gz",
"snap"
],
"category": "Development"
},
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BonBon",
"version": "1.0.5",
"version": "1.0.6",
"description": "BonBon Browser",
"license": "GPL-3.0",
"author": {
Expand Down
41 changes: 41 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: bonbon-browser
version: '1.0.6'
summary: A web browser built with Electron, TypeScript, and React
description: |
BonBon Web Browser is an open-source web browser built using Electron, React, and TypeScript. It provides a customizable and easy-to-use interface with modern web technologies.
grade: stable
confinement: strict

apps:
bonbon:
command: desktop-launch $SNAP/bonbon-browser/bonbon
plugs:
- network
- browser-support
- network-bind
- pulseaudio
- opengl
- home
- x11
- unity7
- wayland

parts:
bonbon-browser:
plugin: dump
source: .
stage-packages:
- libnss3
- libgtk-3-0
- libxss1
- libgconf-2-4
build-packages:
- nodejs
- npm
override-build: |
npm install
npm run build
npm run package
after:
- desktop-gtk3

0 comments on commit fbb3dc5

Please sign in to comment.