diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..04ec4d9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,67 @@ +name: Build and Release + +on: + push: + branches: [main, feat/build-package] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + os: [macos-latest, windows-latest] + include: + - os: macos-latest + platform: darwin + - os: windows-latest + platform: win32 + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Build Electron app + run: npm run make + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.platform }}-build + path: out/make/**/* + + release: + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ github.run_number }} + name: Release ${{ github.run_number }} + draft: true + files: | + **/*.zip + **/*.exe + **/*.dmg + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/forge.config.js b/forge.config.js index 6daf2bd..ceceff7 100644 --- a/forge.config.js +++ b/forge.config.js @@ -1,45 +1,25 @@ -const { FusesPlugin } = require('@electron-forge/plugin-fuses'); -const { FuseV1Options, FuseVersion } = require('@electron/fuses'); +const { FusesPlugin } = require("@electron-forge/plugin-fuses"); +const { FuseV1Options, FuseVersion } = require("@electron/fuses"); module.exports = { packagerConfig: { asar: true, + platform: ["darwin", "win32"], }, rebuildConfig: {}, makers: [ { - name: '@electron-forge/maker-squirrel', - config: {}, - }, - { - name: '@electron-forge/maker-zip', - platforms: ['darwin'], - config: { - arch: 'universal' - } - }, - - { - name: '@electron-forge/maker-deb', - config: {}, - }, - { - name: '@electron-forge/maker-rpm', - config: {}, + name: "@electron-forge/maker-zip", + platforms: ["darwin"], }, { - name: '@electron-forge/maker-dmg', - platforms: ['darwin'], - config: { - title: 'ilr_file_creator', - arch: 'universal', - overwrite: true - } + name: "@electron-forge/maker-zip", + platforms: ["win32"], }, ], plugins: [ { - name: '@electron-forge/plugin-auto-unpack-natives', + name: "@electron-forge/plugin-auto-unpack-natives", config: {}, }, // Fuses are used to enable/disable various Electron functionality