1- name : Build and Release Binaries
2-
3- on :
4- push :
5- tags :
6- - ' v*.*.*'
7-
8- permissions :
9- contents : write
10-
1+ name : Build Binaries
2+ on : [push]
113jobs :
124 build :
135 runs-on : ${{ matrix.os }}
2214 - run : npm install
2315 - run : npm run build
2416 - run : npm install pkg@latest -g
25- - run : pkg . --targets node18-${{ matrix.os == 'ubuntu-latest' && 'linux-x64' || 'darwin-x64' }},node18-darwin-arm64 --output griq --verbose
26- # Added --verbose for debugging; adjust targets as needed
27- - run : ls -lh # Debug step to list generated files
28- - name : Rename binaries with OS suffix
29- run : |
30- if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then
31- [ -f griq ] && mv griq griq-ubuntu || echo "griq not found"
32- elif [ "${{ matrix.os }}" = "macos-latest" ]; then
33- [ -f griq ] && mv griq griq-macos-x64 || echo "griq not found"
34- # ARM64 handling can be added if pkg generates a separate arm64 binary
35- fi
36- - name : Create Release
37- id : create_release
38- uses : actions/create-release@v1
39- if : startsWith(github.ref, 'refs/tags/')
40- env :
41- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
17+ - run : pkg . --targets node18-linux-x64,node18-darwin-x64,node18-darwin-arm64 --output griq
18+ - uses : actions/upload-artifact@v4
4219 with :
43- tag_name : ${{ github.ref_name }}
44- release_name : Release ${{ github.ref_name }}
45- draft : false
46- prerelease : false
47- - name : Upload Release Assets
48- uses : actions/upload-release-asset@v1
49- if : startsWith(github.ref, 'refs/tags/')
50- env :
51- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52- with :
53- upload_url : ${{ steps.create_release.outputs.upload_url }}
54- asset_path : griq-${{ matrix.os == 'ubuntu-latest' && 'ubuntu' || 'macos-x64' }}
55- asset_name : griq-${{ matrix.os == 'ubuntu-latest' && 'ubuntu' || 'macos-x64' }}
56- asset_content_type : application/octet-stream
57- - name : Upload macOS ARM64 Asset (if macOS)
58- if : matrix.os == 'macos-latest' && startsWith(github.ref, 'refs/tags/')
59- uses : actions/upload-release-asset@v1
60- env :
61- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62- with :
63- upload_url : ${{ steps.create_release.outputs.upload_url }}
64- asset_path : griq-macos-arm64
65- asset_name : griq-macos-arm64
66- asset_content_type : application/octet-stream
20+ name : binaries-${{ matrix.os }}
21+ path : griq-*
0 commit comments