From 4fed3694b250254041cb2f56a8134cc4010e4dbb Mon Sep 17 00:00:00 2001 From: Selim Date: Wed, 26 Aug 2026 22:16:14 +0300 Subject: [PATCH 1/7] ci: add Windows build script --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8ddf3c7..239cf18 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "license": "MIT", "scripts": { "start": "electron .", - "dist": "electron-builder --windows" + "dist": "electron-builder --windows", + "dist:win": "electron-builder --windows" }, "build": { "appId": "com.selim.codesnip", From 3b756e0cd73f468712458e7278c54d8986604e7a Mon Sep 17 00:00:00 2001 From: Selim Date: Wed, 26 Aug 2026 22:16:19 +0300 Subject: [PATCH 2/7] ci: add CodeSnip Windows build workflow --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..831fa6f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CodeSnip CI + +on: + push: + branches: + - 26Q2.5 + - main + - '26Q3*' + pull_request: + branches: + - 26Q2.5 + - main + - '26Q3*' + +permissions: + contents: read + +jobs: + build: + name: Build CodeSnip + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build Windows application + run: npm run dist:win From 5c5d235f25e293d94e3cb3cfd61ca90c9872e10d Mon Sep 17 00:00:00 2001 From: Selim Date: Wed, 26 Aug 2026 22:16:30 +0300 Subject: [PATCH 3/7] ci: publish Windows build as workflow artifact --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 831fa6f..4dd1234 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,3 +35,10 @@ jobs: - name: Build Windows application run: npm run dist:win + + - name: Upload Windows build + uses: actions/upload-artifact@v4 + with: + name: CodeSnip-Windows + path: dist/*.exe + if-no-files-found: error From c110240858d0ed4f3560d6f551d302c92ac8a849 Mon Sep 17 00:00:00 2001 From: Selim Date: Wed, 26 Aug 2026 22:16:35 +0300 Subject: [PATCH 4/7] ci: add automated GitHub release workflow --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..752775c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: CodeSnip Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + release: + name: Build and Release CodeSnip + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build Windows application + run: npm run dist:win + + - name: Create GitHub Release + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + run: | + $assets = Get-ChildItem -Path dist -Filter *.exe | ForEach-Object { $_.FullName } + if (-not $assets) { + throw 'No Windows executable was produced.' + } + gh release create "${{ github.ref_name }}" $assets --generate-notes --title "CodeSnip ${{ github.ref_name }}" From cb9c1248d3e4d0dde38c924c7347ce4c0c8f9a8f Mon Sep 17 00:00:00 2001 From: Selim Date: Thu, 27 Aug 2026 09:55:50 +0300 Subject: [PATCH 5/7] ci: fix Windows build workflow --- .github/workflows/ci.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dd1234..754e47b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,10 +31,17 @@ jobs: cache: npm - name: Install dependencies - run: npm ci + run: npm ci --include=dev - name: Build Windows application - run: npm run dist:win + run: npx electron-builder --win portable --publish never + env: + CSC_IDENTITY_AUTO_DISCOVERY: 'false' + + - name: Verify Windows build + shell: pwsh + run: | + Get-ChildItem -Path dist -Filter *.exe -ErrorAction Stop - name: Upload Windows build uses: actions/upload-artifact@v4 From 88c50f144f54e5bc06730b9d5a2987aeaa3283da Mon Sep 17 00:00:00 2001 From: Selim Date: Thu, 27 Aug 2026 09:56:04 +0300 Subject: [PATCH 6/7] fix: declare Electron build dependencies --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 239cf18..9100f1e 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,10 @@ "dist": "electron-builder --windows", "dist:win": "electron-builder --windows" }, + "devDependencies": { + "electron": "^31.0.0", + "electron-builder": "^26.15.3" + }, "build": { "appId": "com.selim.codesnip", "productName": "CodeSnip", From 1c8d593b55cc0cc1417986a45b703b7da594d408 Mon Sep 17 00:00:00 2001 From: Selim Date: Thu, 27 Aug 2026 09:57:11 +0300 Subject: [PATCH 7/7] fix: normalize Electron version for CI build --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 754e47b..da42a42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,12 +27,16 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: 20 + node-version: 22 cache: npm - name: Install dependencies run: npm ci --include=dev + - name: Normalize Electron version + shell: pwsh + run: npm pkg set version=26.2.5 + - name: Build Windows application run: npx electron-builder --win portable --publish never env: @@ -41,7 +45,9 @@ jobs: - name: Verify Windows build shell: pwsh run: | - Get-ChildItem -Path dist -Filter *.exe -ErrorAction Stop + $exe = Get-ChildItem -Path dist -Filter *.exe -ErrorAction Stop + if (-not $exe) { throw 'Windows executable was not produced.' } + $exe | Format-Table Name, Length - name: Upload Windows build uses: actions/upload-artifact@v4