wireshade 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,111 @@
1
+ name: Build and Publish
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - 'v*'
9
+ pull_request:
10
+
11
+ env:
12
+ DEBUG: 'napi:*'
13
+ MACOSX_DEPLOYMENT_TARGET: '10.13'
14
+
15
+ jobs:
16
+ build:
17
+ name: Build ${{ matrix.settings.target }}
18
+ runs-on: ${{ matrix.settings.host }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ settings:
23
+ - host: windows-latest
24
+ target: x86_64-pc-windows-msvc
25
+ build: npm run build
26
+ - host: ubuntu-latest
27
+ target: x86_64-unknown-linux-gnu
28
+ zig: true
29
+ build: npm run build -- --target x86_64-unknown-linux-gnu --cross-compile
30
+ - host: ubuntu-latest
31
+ target: aarch64-unknown-linux-gnu
32
+ zig: true
33
+ build: npm run build -- --target aarch64-unknown-linux-gnu --cross-compile
34
+ - host: ubuntu-latest
35
+ target: armv7-unknown-linux-gnueabihf
36
+ zig: true
37
+ build: npm run build -- --target armv7-unknown-linux-gnueabihf --cross-compile
38
+ - host: macos-latest
39
+ target: x86_64-apple-darwin
40
+ build: npm run build -- --target x86_64-apple-darwin
41
+ - host: macos-latest
42
+ target: aarch64-apple-darwin
43
+ build: npm run build -- --target aarch64-apple-darwin
44
+
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+
48
+ - name: Setup node
49
+ uses: actions/setup-node@v4
50
+ with:
51
+ node-version: 20
52
+ cache: npm
53
+
54
+ - name: Install Rust
55
+ uses: dtolnay/rust-toolchain@stable
56
+ with:
57
+ toolchain: stable
58
+ targets: ${{ matrix.settings.target }}
59
+
60
+ - name: Install Zig
61
+ if: ${{ matrix.settings.zig }}
62
+ uses: goto-bus-stop/setup-zig@v2
63
+ with:
64
+ version: 0.13.0
65
+
66
+ - name: Install Dependencies
67
+ run: npm install
68
+
69
+ - name: Build
70
+ run: ${{ matrix.settings.build }}
71
+
72
+ - name: Upload artifacts
73
+ uses: actions/upload-artifact@v4
74
+ with:
75
+ name: bindings-${{ matrix.settings.target }}
76
+ path: wireshade.*.node
77
+ if-no-files-found: error
78
+
79
+ publish:
80
+ name: Publish to npm
81
+ runs-on: ubuntu-latest
82
+ needs: build
83
+ if: startsWith(github.ref, 'refs/tags/v')
84
+ steps:
85
+ - uses: actions/checkout@v4
86
+
87
+ - name: Setup node
88
+ uses: actions/setup-node@v4
89
+ with:
90
+ node-version: 20
91
+ registry-url: 'https://registry.npmjs.org'
92
+
93
+ - name: Install Dependencies
94
+ run: npm install
95
+
96
+ - name: Download all artifacts
97
+ uses: actions/download-artifact@v4
98
+ with:
99
+ path: artifacts
100
+
101
+ - name: Move artifacts
102
+ run: |
103
+ mv artifacts/bindings-*/wireshade.*.node .
104
+ ls -R wireshade.*.node
105
+
106
+ - name: Publish
107
+ env:
108
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
109
+ run: |
110
+ npm publish
111
+ echo "Successfully published to npm"