Skip to content

Commit 5ee4eab

Browse files
chore: prepare for v0.3.0 release
1 parent 4eacf47 commit 5ee4eab

File tree

12 files changed

+159
-17
lines changed

12 files changed

+159
-17
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
node-version: [22.x]
1919

2020
steps:
21-
- uses: actions/checkout@v6
21+
- uses: actions/checkout@v4
2222

2323
- name: Use Node.js ${{ matrix.node-version }}
24-
uses: actions/setup-node@v6
24+
uses: actions/setup-node@v4
2525
with:
2626
node-version: ${{ matrix.node-version }}
2727
cache: 'npm'

.github/workflows/release.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
contents: write
1313

1414
steps:
15-
- uses: actions/checkout@v6
15+
- uses: actions/checkout@v4
1616

1717
- name: Use Node.js 22.x
18-
uses: actions/setup-node@v6
18+
uses: actions/setup-node@v4
1919
with:
2020
node-version: 22.x
2121
cache: 'npm'
@@ -35,24 +35,28 @@ jobs:
3535
- name: Build
3636
run: npm run build
3737

38-
- name: Package
38+
- name: Package (SEA)
3939
run: npm run package
4040

41-
- name: Generate Checksums
42-
run: |
43-
Get-FileHash dist\*, installer\Output\* -Algorithm SHA256 | Select-Object Hash, Path | ForEach-Object { "$($_.Hash) $(Split-Path $_.Path -Leaf)" } | Out-File SHA256SUMS.txt
44-
4541
- name: Install Inno Setup
46-
run: choco install innosetup
42+
run: choco install innosetup -y --no-progress
4743

4844
- name: Build Installer
4945
run: npm run installer
5046

47+
- name: Stage Artifacts
48+
run: npm run stage
49+
50+
- name: Verify Artifacts
51+
run: |
52+
if (-not (Test-Path artifacts/cloudsqlctl.exe)) { throw "Missing cloudsqlctl.exe" }
53+
if (-not (Test-Path artifacts/cloudsqlctl-setup.exe)) { throw "Missing cloudsqlctl-setup.exe" }
54+
if (-not (Test-Path artifacts/cloudsqlctl-windows-x64.zip)) { throw "Missing zip bundle" }
55+
if (-not (Test-Path artifacts/SHA256SUMS.txt)) { throw "Missing SHA256SUMS.txt" }
56+
5157
- name: Release
5258
uses: softprops/action-gh-release@v2
5359
if: startsWith(github.ref, 'refs/tags/')
5460
with:
55-
files: |
56-
bin/cloudsqlctl.exe
57-
dist/cloudsqlctl-setup.exe
61+
files: artifacts/*
5862
generate_release_notes: true

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Changelog
2+
3+
## [0.3.0] - 2025-12-21
4+
5+
### Added
6+
7+
- **Setup Wizard**: New `setup` command for interactive initialization.
8+
- **Auth Management**: New `auth` command for handling gcloud login, ADC, and Service Accounts.
9+
- **Paths Command**: New `paths` command to display system paths and configuration sources.
10+
- **Artifact Staging**: Standardized build artifacts (`artifacts/`) with SHA256 checksums.
11+
- **Versioning**: Single source of truth for versioning via `package.json`.
12+
13+
### Changed
14+
15+
- **Installer**: Updated Inno Setup script to support dynamic versioning and smarter binary reuse.
16+
- **CI/CD**: Upgraded GitHub Actions to v4, fixed release workflow, and added artifact verification.
17+
- **Service Management**: Improved Windows Service handling with argument support and ACL hardening.
18+
- **Documentation**: Updated README with correct paths and new commands.
19+
20+
### Fixed
21+
22+
- **Build**: Resolved duplicate exports in service module.
23+
- **Types**: Fixed TypeScript errors in self-heal and service commands.
24+
- **Linting**: Corrected Markdown formatting issues.

CHANGELOG_DRAFT.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- markdownlint-disable MD024 -->
2+
13
# Changelog
24

35
## [0.3.0] - 2025-12-21

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,24 @@ cloudsqlctl status
9898
## Configuration
9999

100100
Configuration and logs are stored in:
101-
`%LOCALAPPDATA%\CloudSQLCTL`
101+
102+
- **User Scope (Default):** `%LOCALAPPDATA%\CloudSQLCTL`
103+
- **Machine Scope (Service):** `%ProgramData%\CloudSQLCTL`
104+
105+
You can view the exact paths used by your current environment:
106+
107+
```powershell
108+
cloudsqlctl paths
109+
```
110+
111+
## Release
112+
113+
This project uses GitHub Actions for automated releases.
114+
115+
1. Tag a new version: `git tag v0.3.0`
116+
2. Push the tag: `git push origin v0.3.0`
117+
3. The workflow will build, test, sign (if configured), and publish artifacts to the [Releases](https://github.com/Kinin-Code-Offical/cloudsqlctl/releases) page.
118+
`%LOCALAPPDATA%\CloudSQLCTL`
102119

103120
- `config.json`: User preferences and selected instance.
104121
- `logs/`: Application and proxy logs.

installer/cloudsqlctl.iss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#define MyAppName "CloudSQLCTL"
2-
#define MyAppVersion "0.2.0"
2+
#ifndef MyAppVersion
3+
#define MyAppVersion "0.0.0"
4+
#endif
35
#define MyAppPublisher "Kinin Code"
46
#define MyAppURL "https://github.com/Kinin-Code-Offical/cloudsqlctl"
57
#define MyAppExeName "cloudsqlctl.exe"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"build": "tsup src/cli.ts --format cjs --minify --out-dir dist --no-splitting",
1515
"package": "npm run build && powershell -ExecutionPolicy Bypass -File tools/build-sea.ps1",
1616
"installer": "powershell -ExecutionPolicy Bypass -File tools/build-installer.ps1",
17-
"zip": "powershell -Command \"Get-ChildItem -Path . -Force | Where-Object { $_.Name -notin 'node_modules', 'dist', 'bin', 'coverage', '.git', '.vs', '.DS_Store' -and $_.Extension -notin '.zip', '.exe', '.log' } | Compress-Archive -DestinationPath cloudsqlctl.zip -Force\"",
17+
"stage": "powershell -ExecutionPolicy Bypass -File tools/stage-artifacts.ps1",
1818
"lint": "eslint src",
1919
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --passWithNoTests",
2020
"prepare": "husky install"

src/cli.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { checkCommand } from './commands/check.js';
1919
import { gcloudCommand } from './commands/gcloud.js';
2020
import { authCommand } from './commands/auth.js';
2121
import { setupCommand } from './commands/setup.js';
22+
import { pathsCommand } from './commands/paths.js';
2223
import { logger } from './core/logger.js';
2324
import { createRequire } from 'module';
2425

@@ -51,6 +52,7 @@ program.addCommand(checkCommand);
5152
program.addCommand(gcloudCommand);
5253
program.addCommand(authCommand);
5354
program.addCommand(setupCommand);
55+
program.addCommand(pathsCommand);
5456

5557
program.parseAsync(process.argv).catch(err => {
5658
logger.error('Unhandled error', err);

src/commands/paths.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { Command } from 'commander';
2+
import { PATHS, ENV_VARS } from '../system/paths.js';
3+
import chalk from 'chalk';
4+
5+
export const pathsCommand = new Command('paths')
6+
.description('Show resolved system paths and configuration locations')
7+
.action(async () => {
8+
console.log(chalk.bold('\nCloudSQLCTL Paths Configuration\n'));
9+
10+
const rows = [
11+
{ key: 'Home Dir', value: PATHS.HOME },
12+
{ key: 'Bin Dir', value: PATHS.BIN },
13+
{ key: 'Logs Dir', value: PATHS.LOGS },
14+
{ key: 'Config File', value: PATHS.CONFIG_FILE },
15+
{ key: 'Proxy Exe', value: PATHS.PROXY_EXE },
16+
{ key: 'Secrets Dir', value: PATHS.SECRETS },
17+
];
18+
19+
rows.forEach(row => {
20+
console.log(`${chalk.cyan(row.key.padEnd(15))}: ${row.value}`);
21+
});
22+
23+
console.log(chalk.bold('\nResolution Source:'));
24+
25+
if (process.env[ENV_VARS.PROXY_PATH]) {
26+
console.log(`- ${chalk.green('Environment Variable')} (${ENV_VARS.PROXY_PATH}) is set.`);
27+
} else if (PATHS.HOME.includes('ProgramData')) {
28+
console.log(`- ${chalk.yellow('System Installation')} (ProgramData detected).`);
29+
} else {
30+
console.log(`- ${chalk.blue('User Installation')} (AppData detected).`);
31+
}
32+
33+
console.log('');
34+
});

src/system/paths.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function resolvePaths() {
5050
TEMP: path.join(home, 'temp'),
5151
GCLOUD_DIR: path.join(home, 'gcloud'),
5252
PID_FILE: path.join(home, 'proxy.pid'),
53+
SECRETS: path.join(home, 'secrets'),
5354
};
5455
}
5556

0 commit comments

Comments
 (0)