From 4ced1c2fde07cb201fd4a27910e6c5720c9c449a Mon Sep 17 00:00:00 2001 From: Avi Zimmerman Date: Sun, 5 Nov 2023 20:16:30 +0200 Subject: [PATCH] ci: use matrix build --- .github/workflows/ci.yaml | 34 +++++++++---------- .../darwin/com.webmeshproj.webmeshd.plist | 0 {include => contrib}/darwin/components.plist | 0 {include => contrib}/darwin/postinstall | 0 {include => contrib}/darwin/preinstall | 0 {include => contrib}/windows/webmesh.wxs | 0 include/linux/webmeshd.service | 17 ---------- package.json | 3 ++ 8 files changed, 19 insertions(+), 35 deletions(-) rename {include => contrib}/darwin/com.webmeshproj.webmeshd.plist (100%) rename {include => contrib}/darwin/components.plist (100%) rename {include => contrib}/darwin/postinstall (100%) rename {include => contrib}/darwin/preinstall (100%) rename {include => contrib}/windows/webmesh.wxs (100%) delete mode 100644 include/linux/webmeshd.service diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0fd43e0..3176bbe 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,12 +8,21 @@ on: env: WEBMESH_VERSION: main - CACHE_DEP_PATH: yarn.lock jobs: build: - name: Build - runs-on: ${{ vars.BUILD_PLATFORM == '' && 'ubuntu-latest' || vars.BUILD_PLATFORM }} + name: Build Package + strategy: + matrix: + target: [linux, mac, win] + include: + - target: linux + runner: ${{ vars.LINUX_BUILD_PLATFORM }} + - target: mac + runner: ${{ vars.MACOS_BUILD_PLATFORM }} + - target: win + runner: ${{ vars.WINDOWS_BUILD_PLATFORM }} + runs-on: ${{ matrix.runner }} permissions: contents: 'read' id-token: 'write' @@ -36,7 +45,7 @@ jobs: with: go-version: stable check-latest: true - cache: ${{ !startswith(vars.BUILD_PLATFORM, 'self-hosted') }} + cache: ${{ !startswith(matrix.runner, 'self-hosted') }} cache-dependency-path: webmesh/go.sum - name: Setup Node @@ -45,19 +54,8 @@ jobs: check-latest: true node-version-file: .nvmrc - - name: Install Wine on Hosted Ubuntu Runners - if: ${{ startswith(vars.BUILD_PLATFORM, 'ubuntu') }} - run: | - set -ex - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install -y wine64 wine32 - - - name: Install UPX on Hosted macOS Runners - if: ${{ startswith(vars.BUILD_PLATFORM, 'macos') }} - run: brew install upx - - - name: Build Webmesh Daemon + - name: Build Webmesh Helper Daemon + if: ${{ matrix.target != 'linux' }} env: PARALLEL: 6 run: cd webmesh && make dist-webmeshd @@ -65,4 +63,4 @@ jobs: - name: Build Electron App env: GH_TOKEN: ${{ github.token }} - run: yarn && yarn build:all + run: yarn && yarn build:${{ matrix.target }} diff --git a/include/darwin/com.webmeshproj.webmeshd.plist b/contrib/darwin/com.webmeshproj.webmeshd.plist similarity index 100% rename from include/darwin/com.webmeshproj.webmeshd.plist rename to contrib/darwin/com.webmeshproj.webmeshd.plist diff --git a/include/darwin/components.plist b/contrib/darwin/components.plist similarity index 100% rename from include/darwin/components.plist rename to contrib/darwin/components.plist diff --git a/include/darwin/postinstall b/contrib/darwin/postinstall similarity index 100% rename from include/darwin/postinstall rename to contrib/darwin/postinstall diff --git a/include/darwin/preinstall b/contrib/darwin/preinstall similarity index 100% rename from include/darwin/preinstall rename to contrib/darwin/preinstall diff --git a/include/windows/webmesh.wxs b/contrib/windows/webmesh.wxs similarity index 100% rename from include/windows/webmesh.wxs rename to contrib/windows/webmesh.wxs diff --git a/include/linux/webmeshd.service b/include/linux/webmeshd.service deleted file mode 100644 index 62c63ce..0000000 --- a/include/linux/webmeshd.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Webmesh Daemon -After=network.target - -[Service] -Type=simple -ExecStart=/usr/bin/webmesh-node \ - --daemon.enabled=true \ - --daemon.grpc-web=true \ - --daemon.cors.enabled=true \ - --daemon.bind=127.0.0.1:58080 \ - --daemon.persistence.path=/var/lib/webmeshd -Restart=always -RestartSec=5 - -[Install] -WantedBy=multi-user.target diff --git a/package.json b/package.json index e5a0546..b040852 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,9 @@ "test": "echo \"No test specified\" && exit 0", "dev": "quasar dev --mode electron", "build": "rm -rf dist/ ; quasar build --modern --mode electron", + "build:win": "rm -rf dist/ ; quasar build --modern --mode electron --target win", + "build:mac": "rm -rf dist/ ; quasar build --modern --mode electron --target mac", + "build:linux": "rm -rf dist/ ; quasar build --modern --mode electron --target linux", "build:all": "rm -rf dist/ ; quasar build --modern --mode electron --target all", "clean": "rm -rf dist/ node_modules/ && yarn" },