noupload 1.0.1 → 1.0.2

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.
@@ -17,29 +17,24 @@ jobs:
17
17
  include:
18
18
  - os: ubuntu-latest
19
19
  target: linux-x64
20
- pkg_target: node18-linux-x64
20
+ bun_target: bun-linux-x64
21
21
  - os: ubuntu-latest
22
22
  target: linux-arm64
23
- pkg_target: node18-linux-arm64
23
+ bun_target: bun-linux-arm64
24
24
  - os: macos-latest
25
25
  target: darwin-x64
26
- pkg_target: node18-macos-x64
26
+ bun_target: bun-darwin-x64
27
27
  - os: macos-latest
28
28
  target: darwin-arm64
29
- pkg_target: node18-macos-arm64
29
+ bun_target: bun-darwin-arm64
30
30
  - os: windows-latest
31
31
  target: windows-x64
32
- pkg_target: node18-win-x64
32
+ bun_target: bun-windows-x64
33
33
 
34
34
  steps:
35
35
  - uses: actions/checkout@v4
36
36
 
37
- - name: Setup Node.js
38
- uses: actions/setup-node@v4
39
- with:
40
- node-version: '18'
41
-
42
- - name: Setup Bun (for building dist)
37
+ - name: Setup Bun
43
38
  uses: oven-sh/setup-bun@v1
44
39
  with:
45
40
  bun-version: latest
@@ -47,20 +42,27 @@ jobs:
47
42
  - name: Install Dependencies
48
43
  run: bun install
49
44
 
50
- - name: Build dist
51
- run: bun run build
45
+ - name: Build Binary (Unix)
46
+ if: matrix.os != 'windows-latest'
47
+ run: bun build src/index.ts --compile --target ${{ matrix.bun_target }} --outfile noupload-${{ matrix.target }}
52
48
 
53
- - name: Install pkg
54
- run: npm install -g pkg
49
+ - name: Build Binary (Windows)
50
+ if: matrix.os == 'windows-latest'
51
+ run: bun build src/index.ts --compile --target ${{ matrix.bun_target }} --outfile noupload-${{ matrix.target }}.exe
55
52
 
56
- - name: Build Binary
57
- run: pkg dist/index.js --target ${{ matrix.pkg_target }} --output noupload-${{ matrix.target }}
53
+ - name: Upload Artifact (Unix)
54
+ if: matrix.os != 'windows-latest'
55
+ uses: actions/upload-artifact@v4
56
+ with:
57
+ name: noupload-${{ matrix.target }}
58
+ path: noupload-${{ matrix.target }}
58
59
 
59
- - name: Upload Artifact
60
+ - name: Upload Artifact (Windows)
61
+ if: matrix.os == 'windows-latest'
60
62
  uses: actions/upload-artifact@v4
61
63
  with:
62
64
  name: noupload-${{ matrix.target }}
63
- path: noupload-${{ matrix.target }}*
65
+ path: noupload-${{ matrix.target }}.exe
64
66
 
65
67
  release:
66
68
  needs: build
@@ -70,15 +72,53 @@ jobs:
70
72
 
71
73
  - name: Download Artifacts
72
74
  uses: actions/download-artifact@v4
75
+ with:
76
+ path: artifacts
77
+
78
+ - name: List artifacts
79
+ run: find artifacts -type f
73
80
 
74
81
  - name: Create Release
75
82
  uses: softprops/action-gh-release@v1
76
83
  with:
77
84
  files: |
78
- noupload-linux-x64/noupload-linux-x64
79
- noupload-linux-arm64/noupload-linux-arm64
80
- noupload-darwin-x64/noupload-darwin-x64
81
- noupload-darwin-arm64/noupload-darwin-arm64
82
- noupload-windows-x64/noupload-windows-x64.exe
85
+ artifacts/noupload-linux-x64/noupload-linux-x64
86
+ artifacts/noupload-linux-arm64/noupload-linux-arm64
87
+ artifacts/noupload-darwin-x64/noupload-darwin-x64
88
+ artifacts/noupload-darwin-arm64/noupload-darwin-arm64
89
+ artifacts/noupload-windows-x64/noupload-windows-x64.exe
83
90
  draft: false
84
91
  prerelease: false
92
+
93
+ npm-publish:
94
+ needs: build
95
+ runs-on: ubuntu-latest
96
+ steps:
97
+ - uses: actions/checkout@v4
98
+
99
+ - name: Setup Bun
100
+ uses: oven-sh/setup-bun@v1
101
+ with:
102
+ bun-version: latest
103
+
104
+ - name: Setup Node.js
105
+ uses: actions/setup-node@v4
106
+ with:
107
+ node-version: '20'
108
+ registry-url: 'https://registry.npmjs.org'
109
+
110
+ - name: Install Dependencies
111
+ run: bun install
112
+
113
+ - name: Build for npm
114
+ run: bun run build
115
+
116
+ - name: Add shebang to dist
117
+ run: |
118
+ echo '#!/usr/bin/env node' | cat - dist/index.js > temp && mv temp dist/index.js
119
+ chmod +x dist/index.js
120
+
121
+ - name: Publish to npm
122
+ run: npm publish
123
+ env:
124
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}