Merge pull request #9 from frysee/fix-builds

Thanks! This will do well for now 😊 I gotta look into stripping some of the redundant code.
No need to upload the artifacts tho, as the build workflow doesn't create a release.
This commit is contained in:
Robert Kossessa
2024-06-12 18:14:24 +02:00
committed by GitHub
3 changed files with 71 additions and 5 deletions

60
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,60 @@
on:
push:
branches:
- '*'
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: 🐧 Linux
os: ubuntu-latest
pnpm_command: 'build:linux'
binary_path: dist/*.AppImage
asset_name: zeroone.AppImage
- name: 🪟 Windows
os: windows-latest
pnpm_command: 'build:win'
binary_path: dist/*.exe
asset_name: zeroone.exe
- name: 🍏 Mac
os: macos-latest
pnpm_command: 'build:mac'
binary_path: dist/*.dmg
asset_name: zeroone.dmg
name: ${{ matrix.name }} Build
runs-on: ${{ matrix.os }}
steps:
- name: 🚚 Checkout latest code
uses: actions/checkout@v4
- name: 🟩 Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: ⚡ Setup pnpm
uses: pnpm/action-setup@v4.0.0
#TODO - Remove this once https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889 is resolved
- name: Tweak pnpm.cjs
if: ${{ contains(matrix.os, 'windows') }}
run: sed -i 's/\/usr\/bin\/env node/node/g' /c/Users/runneradmin/setup-pnpm/node_modules/.pnpm/pnpm@9.3.0/node_modules/pnpm/bin/pnpm.cjs
shell: bash
- name: 🔨 Build Project
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm i
pnpm ${{ matrix.pnpm_command }}
- name: 📦 Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.binary_path }}
permissions:
contents: write

View File

@@ -13,10 +13,10 @@ jobs:
- name: 🐧 Linux
os: ubuntu-latest
pnpm_command: 'build:linux'
binary_path: dist/*.deb
asset_name: zeroone.deb
binary_path: dist/*.AppImage
asset_name: zeroone.AppImage
- name: 🪟 Windows
os: macos-latest
os: windows-latest
pnpm_command: 'build:win'
binary_path: dist/*.exe
asset_name: zeroone.exe
@@ -44,7 +44,13 @@ jobs:
node-version: '20.x'
- name: ⚡ Setup pnpm
uses: pnpm/action-setup@v3.0.0
uses: pnpm/action-setup@v4.0.0
#TODO - Remove this once https://github.com/electron-userland/electron-builder/issues/6933#issuecomment-1213438889 is resolved
- name: Tweak pnpm.cjs
if: ${{ contains(matrix.os, 'windows') }}
run: sed -i 's/\/usr\/bin\/env node/node/g' /c/Users/runneradmin/setup-pnpm/node_modules/.pnpm/pnpm@9.3.0/node_modules/pnpm/bin/pnpm.cjs
shell: bash
- name: 🔨 Build Project
env:

View File

@@ -4,7 +4,7 @@
"description": "Configuration Suite for Binaris Devices",
"main": "./out/main/index.js",
"author": "katbinaris",
"packageManager": "pnpm@8.14.1",
"packageManager": "pnpm@9.3.0",
"homepage": "https://github.com/katbinaris/zeroone",
"build": {
"productName": "ZERO_ONE"