diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6240ba9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,103 @@ +name: Build and Release + +on: + push: + branches: + - main + tags: + - 'v*' + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + include: + - os: ubuntu-latest + platform: linux + - os: windows-latest + platform: win + - os: macos-latest + platform: mac + + 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 for Linux + if: matrix.platform == 'linux' + run: npm run build:linux + + - name: Build for Windows + if: matrix.platform == 'win' + run: npm run build:win + + - name: Build for macOS (Universal) + if: matrix.platform == 'mac' + run: npm run build:mac + + - name: Upload Linux artifacts + if: matrix.platform == 'linux' + uses: actions/upload-artifact@v4 + with: + name: linux-builds + path: | + dist/*.AppImage + dist/*.deb + + - name: Upload Windows artifacts + if: matrix.platform == 'win' + uses: actions/upload-artifact@v4 + with: + name: windows-builds + path: | + dist/*.exe + + - name: Upload macOS artifacts + if: matrix.platform == 'mac' + uses: actions/upload-artifact@v4 + with: + name: macos-builds + path: | + dist/*.dmg + dist/*.zip + dist/latest-mac.yml + + release: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + permissions: + contents: write + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Display structure of downloaded files + run: ls -R artifacts + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + files: | + artifacts/linux-builds/* + artifacts/windows-builds/* + artifacts/macos-builds/* + generate_release_notes: true + draft: false + prerelease: false diff --git a/package.json b/package.json index 4949bcf..0f17098 100644 --- a/package.json +++ b/package.json @@ -94,15 +94,13 @@ { "target": "dmg", "arch": [ - "x64", - "arm64" + "universal" ] }, { "target": "zip", "arch": [ - "x64", - "arm64" + "universal" ] } ],