From 3ea1fb7daa5c279394034351b164d7985fc76351 Mon Sep 17 00:00:00 2001 From: mileswa1q22 Date: Sun, 30 Aug 2026 22:18:43 -0500 Subject: [PATCH] Switch to build + GitHub Release; fix Linux GTK deps --- .github/workflows/publish.yml | 67 ++++++++++------------------------- 1 file changed, 18 insertions(+), 49 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 42fc27f..bf63dfb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -name: Publish to npm +name: Build native binaries on: push: @@ -36,6 +36,12 @@ jobs: with: targets: ${{ matrix.target }} + - name: Install system dependencies (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y libgtk-3-dev libglib2.0-dev libgobject-2.0-dev libgio-2.0-dev libayatana-appindicator3-dev + - name: Setup Node uses: actions/setup-node@v4 with: @@ -68,62 +74,25 @@ jobs: name: bindings-${{ matrix.target }} path: gelectron_core.*.node - publish: - name: Publish to npm + release: + name: Attach binaries to GitHub Release needs: build runs-on: ubuntu-latest - environment: npm-publish + permissions: + contents: write steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20 - registry-url: 'https://registry.npmjs.org' - - - name: Download all platform packages + - name: Download all binaries uses: actions/download-artifact@v4 with: path: artifacts pattern: bindings-* merge-multiple: true - - name: Install dependencies - run: npm ci + - name: List binaries + run: ls -la artifacts/ - - name: Assemble platform packages - shell: bash - run: | - for node in artifacts/*.node; do - base="$(basename "$node")" - case "$base" in - *.darwin-x64.node) dir="npm/darwin-x64" ;; - *.darwin-arm64.node) dir="npm/darwin-arm64" ;; - *.win32-x64-msvc.node) dir="npm/win32-x64-msvc" ;; - *.win32-arm64-msvc.node) dir="npm/win32-arm64-msvc" ;; - *.linux-x64-gnu.node) dir="npm/linux-x64-gnu" ;; - *.linux-arm64-gnu.node) dir="npm/linux-arm64-gnu" ;; - esac - cp "$node" "$dir/$base" - done - echo "Assembled platform packages:" - ls -la npm/*/ - - - name: Publish platform packages - shell: bash - run: | - for dir in npm/*/; do - cd "$dir" - npm publish --access public - cd ../../ - done - - - name: Publish main package - run: | - npm run prepublishOnly - npm publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Upload binaries to GitHub Release + uses: softprops/action-gh-release@v2 + with: + files: artifacts/*.node