modified: .github/workflows/ci-cd.yml #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ main ] | |
permissions: | |
contents: write | |
env: | |
NODE_VERSION: '20' | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
run: | | |
cd frontend | |
npm ci | |
shell: bash | |
- name: Update version | |
run: | | |
cd frontend | |
git config --global user.email "github-actions@github.com" | |
git config --global user.name "GitHub Actions" | |
npm version patch -m "Bump version to %s [skip ci]" | |
git push origin HEAD:main | |
git push --tags | |
shell: bash | |
- name: Check icon file | |
run: | | |
if (Test-Path frontend/build/icon.ico) { | |
echo "Icon file exists" | |
} else { | |
echo "Icon file is missing" | |
exit 1 | |
} | |
shell: pwsh | |
- name: Build Electron app | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
cd frontend | |
npm run dist:windows | |
shell: bash | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-windows | |
path: frontend/dist/*.exe | |
release: | |
needs: build-windows | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-windows | |
path: dist | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./dist/*.exe | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |