Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
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: 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:
CSC_IDENTITY_AUTO_DISCOVERY: 'false'

- name: Verify Windows build
shell: pwsh
run: |
$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
with:
name: CodeSnip-Windows
path: dist/*.exe
if-no-files-found: error
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
"license": "MIT",
"scripts": {
"start": "electron .",
"dist": "electron-builder --windows"
"dist": "electron-builder --windows",
"dist:win": "electron-builder --windows"
},
"devDependencies": {
"electron": "^31.0.0",
"electron-builder": "^26.15.3"
},
"build": {
"appId": "com.selim.codesnip",
Expand Down
Loading