mirror of
https://github.com/mileswolfallen2/gelectron.git
synced 2026-09-08 12:43:16 +00:00
Switch to build + GitHub Release; fix Linux GTK deps
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Publish to npm
|
name: Build native binaries
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -36,6 +36,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
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
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -68,62 +74,25 @@ jobs:
|
|||||||
name: bindings-${{ matrix.target }}
|
name: bindings-${{ matrix.target }}
|
||||||
path: gelectron_core.*.node
|
path: gelectron_core.*.node
|
||||||
|
|
||||||
publish:
|
release:
|
||||||
name: Publish to npm
|
name: Attach binaries to GitHub Release
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: npm-publish
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Download all binaries
|
||||||
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
|
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
path: artifacts
|
path: artifacts
|
||||||
pattern: bindings-*
|
pattern: bindings-*
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: List binaries
|
||||||
run: npm ci
|
run: ls -la artifacts/
|
||||||
|
|
||||||
- name: Assemble platform packages
|
- name: Upload binaries to GitHub Release
|
||||||
shell: bash
|
uses: softprops/action-gh-release@v2
|
||||||
run: |
|
with:
|
||||||
for node in artifacts/*.node; do
|
files: artifacts/*.node
|
||||||
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 }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user