diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..819e5a0 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 955716e..5fcbd80 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/package.json b/package.json index aa89ca5..d8fd1e7 100644 --- a/package.json +++ b/package.json @@ -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"