File tree Expand file tree Collapse file tree 7 files changed +162
-14
lines changed
Expand file tree Collapse file tree 7 files changed +162
-14
lines changed Original file line number Diff line number Diff line change 1+ name : Build and Test
2+
3+ on :
4+ push :
5+ branches : [ main ]
6+ paths-ignore :
7+ - ' *.md'
8+ - ' docs/**'
9+ pull_request :
10+ branches : [ main ]
11+ paths-ignore :
12+ - ' *.md'
13+ - ' docs/**'
14+
15+ jobs :
16+ build :
17+ runs-on : ubuntu-latest
18+
19+ strategy :
20+ matrix :
21+ node-version : [22.x]
22+
23+ steps :
24+ - name : Checkout repository
25+ uses : actions/checkout@v4
26+
27+ - name : Setup Node.js ${{ matrix.node-version }}
28+ uses : actions/setup-node@v4
29+ with :
30+ node-version : ${{ matrix.node-version }}
31+ cache : ' npm'
32+
33+ - name : Install dependencies
34+ run : npm ci
35+
36+ - name : Run linting
37+ run : npm run lint --if-present
38+
39+ - name : Run tests
40+ run : npm test --if-present
41+
42+ - name : Build project
43+ run : npm run build
44+
45+ - name : Check TypeScript compilation
46+ run : npx tsc --noEmit
47+
48+ - name : Upload build artifacts
49+ if : matrix.node-version == '22.x'
50+ uses : actions/upload-artifact@v4
51+ with :
52+ name : dist-files
53+ path : dist/
54+ retention-days : 30
Original file line number Diff line number Diff line change 1+ name : Install Test
2+
3+ on :
4+ schedule :
5+ # Test installation weekly to ensure it works from GitHub
6+ - cron : ' 0 0 * * 0'
7+ workflow_dispatch :
8+
9+ jobs :
10+ install-test :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Create test project
15+ run : |
16+ mkdir test-install
17+ cd test-install
18+ npm init -y
19+
20+ - name : Test installation from GitHub
21+ run : |
22+ cd test-install
23+ npm install byrdsandbytes/capacitor-zeroconf
24+
25+ - name : Verify package can be imported
26+ run : |
27+ cd test-install
28+ node -e "
29+ try {
30+ const { ZeroConf } = require('capacitor-zeroconf');
31+ console.log('✅ Package imported successfully');
32+ console.log('ZeroConf plugin:', typeof ZeroConf);
33+ } catch (error) {
34+ console.error('❌ Failed to import:', error.message);
35+ process.exit(1);
36+ }
37+ "
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*'
7+
8+ jobs :
9+ release :
10+ runs-on : ubuntu-latest
11+
12+ permissions :
13+ contents : write
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+
21+ - name : Setup Node.js
22+ uses : actions/setup-node@v4
23+ with :
24+ node-version : ' 22.x'
25+ cache : ' npm'
26+
27+ - name : Install dependencies
28+ run : npm ci
29+
30+ - name : Build project
31+ run : npm run build
32+
33+ - name : Run tests
34+ run : npm test --if-present
35+
36+ - name : Create GitHub Release
37+ id : create_release
38+ uses : actions/create-release@v1
39+ env :
40+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41+ with :
42+ tag_name : ${{ github.ref }}
43+ release_name : Release ${{ github.ref }}
44+ body : |
45+ See the [README](https://github.com/byrdsandbytes/capacitor-zeroconf/blob/main/README.md) for usage examples.
46+ draft : false
47+ prerelease : false
48+
49+ - name : Zip dist folder
50+ run : zip -r dist.zip dist/
51+
52+ - name : Upload build artifacts to release
53+ uses : actions/upload-release-asset@v1
54+ env :
55+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
56+ with :
57+ upload_url : ${{ steps.create_release.outputs.upload_url }}
58+ asset_path : ./dist.zip
59+ asset_name : dist.zip
60+ asset_content_type : application/zip
Original file line number Diff line number Diff line change 11# node files
2+ dist
23node_modules
34
45# iOS files
Original file line number Diff line number Diff line change @@ -37,18 +37,6 @@ yarn add byrdsandbytes/capacitor-zeroconf
3737yarn cap sync
3838```
3939
40- ** Note:** If you get TypeScript errors like "Cannot find module 'capacitor-zeroconf'", this means the package wasn't built when installed from GitHub. You can either:
41-
42- 1 . ** Recommended:** Install a specific release tag:
43- ``` bash
44- npm install byrdsandbytes/capacitor-zeroconf#v7.0.0
45- ```
46-
47- 2 . ** Or** manually build after installation:
48- ``` bash
49- cd node_modules/capacitor-zeroconf
50- npm run build
51- ```
5240
5341## Quick Start
5442
@@ -334,7 +322,9 @@ Actions that can occur during service discovery
334322
335323Construct a type with a set of properties K of type T
336324
337- <code >{ [ P in K] : T; }</code >
325+ <code >{
326+ [ P in K ] : T;
327+ }</code >
338328
339329
340330#### ZeroConfWatchCallback
Original file line number Diff line number Diff line change 4949 "build-electron" : " tsc --project electron/tsconfig.json && rollup -c electron/rollup.config.mjs && rimraf ./electron/build" ,
5050 "clean" : " rimraf ./dist" ,
5151 "watch" : " tsc --watch" ,
52- "prepublishOnly" : " yarn build"
52+ "prepublishOnly" : " yarn build" ,
53+ "postinstall" : " npm run build"
5354 },
5455 "devDependencies" : {
5556 "@capacitor/android" : " ^7.0.0" ,
Original file line number Diff line number Diff line change @@ -1016,6 +1016,11 @@ fs.realpath@^1.0.0:
10161016 resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
10171017 integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
10181018
1019+ fsevents@~2.3.2 :
1020+ version "2.3.3"
1021+ resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
1022+ integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
1023+
10191024function-bind@^1.1.1 :
10201025 version "1.1.1"
10211026 resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz"
You can’t perform that action at this time.
0 commit comments