File tree Expand file tree Collapse file tree 8 files changed +42
-22
lines changed
Expand file tree Collapse file tree 8 files changed +42
-22
lines changed Original file line number Diff line number Diff line change @@ -16,25 +16,24 @@ jobs:
1616
1717 steps :
1818 - uses : actions/checkout@v4
19+
1920 - name : Use Node.js ${{ matrix.node-version }}
2021 uses : actions/setup-node@v4
2122 with :
2223 node-version : ${{ matrix.node-version }}
23- cache : " npm"
24- cache-dependency-path : cloudsqlctl/package-lock.json
24+ cache : ' npm'
2525
2626 - name : Install dependencies
2727 run : npm ci
28- working-directory : ./cloudsqlctl
2928
3029 - name : Lint
3130 run : npm run lint
32- working-directory : ./cloudsqlctl
3331
3432 - name : Build
3533 run : npm run build
36- working-directory : ./cloudsqlctl
3734
3835 - name : Test
3936 run : npm test
40- working-directory : ./cloudsqlctl
37+
38+ - name : Package
39+ run : npm run package
Original file line number Diff line number Diff line change 44 directory : ' /'
55 schedule :
66 interval : ' weekly'
7- open-pull-requests-limit : 10
7+ open-pull-requests-limit : 5
88 - package-ecosystem : ' github-actions'
99 directory : ' /'
1010 schedule :
11- interval : ' weekly '
11+ interval : ' monthly '
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ name: Release
33on :
44 push :
55 tags :
6- - " v* "
6+ - ' v* '
77
88jobs :
99 release :
@@ -14,27 +14,24 @@ jobs:
1414 steps :
1515 - uses : actions/checkout@v4
1616
17- - name : Setup Node.js
17+ - name : Use Node.js 22.x
1818 uses : actions/setup-node@v4
1919 with :
20- node-version : " 22"
21- cache : " npm"
22- cache-dependency-path : cloudsqlctl/package-lock.json
20+ node-version : 22.x
21+ cache : ' npm'
2322
2423 - name : Install dependencies
2524 run : npm ci
26- working-directory : ./cloudsqlctl
2725
2826 - name : Build
2927 run : npm run build
30- working-directory : ./cloudsqlctl
3128
32- - name : Package EXE
29+ - name : Package
3330 run : npm run package
34- working-directory : ./cloudsqlctl
3531
36- - name : Create Release
32+ - name : Release
3733 uses : softprops/action-gh-release@v2
34+ if : startsWith(github.ref, 'refs/tags/')
3835 with :
39- files : ./cloudsqlctl/dist /cloudsqlctl.exe
36+ files : bin /cloudsqlctl.exe
4037 generate_release_notes : true
Original file line number Diff line number Diff line change @@ -73,6 +73,30 @@ If you encounter issues:
7373
7474Contributions are welcome! Please see [ CONTRIBUTING.md] ( CONTRIBUTING.md ) for details.
7575
76+ ## Development
77+
78+ ### Prerequisites
79+
80+ - Node.js 22 (LTS)
81+ - PowerShell 5.1 or later
82+
83+ ### Build
84+
85+ To build the project and generate the single executable:
86+
87+ ``` powershell
88+ # Install dependencies
89+ npm install
90+
91+ # Build the source code (TypeScript -> CJS)
92+ npm run build
93+
94+ # Package into a single executable (SEA)
95+ npm run package
96+ ```
97+
98+ The executable will be generated at ` bin/cloudsqlctl.exe ` .
99+
76100## License
77101
78102MIT
Original file line number Diff line number Diff line change 1- import execa from 'execa' ;
1+ import { execa } from 'execa' ;
22import { logger } from './logger.js' ;
33
44export interface GcloudInstance {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import fs from 'fs-extra';
33import path from 'path' ;
44import { PATHS } from './config.js' ;
55import { logger } from './logger.js' ;
6- import execa from 'execa' ;
6+ import { execa } from 'execa' ;
77
88export async function isRunning ( ) : Promise < boolean > {
99 if ( ! await fs . pathExists ( PATHS . PID_FILE ) ) {
Original file line number Diff line number Diff line change @@ -39,8 +39,8 @@ export async function downloadProxy(version: string) {
3939 try {
4040 const releaseUrl = `https://api.github.com/repos/${ GITHUB_REPO } /releases/tags/${ version } ` ;
4141 const response = await axios . get ( releaseUrl ) ;
42- // eslint-disable-next-line @typescript-eslint/no-explicit-any
4342 const assets = response . data . assets ;
43+ logger . info ( `Found ${ assets . length } assets: ${ assets . map ( ( a : any ) => a . name ) . join ( ', ' ) } ` ) ;
4444 // eslint-disable-next-line @typescript-eslint/no-explicit-any
4545 const asset = assets . find ( ( a : any ) => a . name === ASSET_NAME ) ;
4646 // eslint-disable-next-line @typescript-eslint/no-explicit-any
You can’t perform that action at this time.
0 commit comments