diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e9efc6b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: CodeSnip CI + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + validate: + name: Validate project + runs-on: ubuntu-latest + + steps: + - name: Checkout + 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: Validate package.json + run: node -e "const p=require('./package.json'); if (!p.name || !p.version || !p.main) process.exit(1); console.log('package.json OK')" + + - name: Check JavaScript syntax + run: node --check main.js && node --check renderer.js + + build: + name: Build Windows app + runs-on: windows-latest + needs: validate + + steps: + - name: Checkout + 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 portable Windows app + run: npm run dist + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: CodeSnip-Windows + path: dist/*.exe + if-no-files-found: error diff --git a/ci-test.txt b/ci-test.txt new file mode 100644 index 0000000..4b9a94c --- /dev/null +++ b/ci-test.txt @@ -0,0 +1 @@ +CodeSnip CI validation trigger