| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- name: Desktop App Release
- on:
- push:
- branches: [ main ]
- paths:
- - 'src/main/resources/static/**' # Trigger on frontend changes
- - 'desktop-app/**' # Trigger on desktop app changes
- - '.github/workflows/desktop-release.yml' # Trigger on workflow changes
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- jobs:
- create-release:
- name: Create Release
- runs-on: ubuntu-latest
- outputs:
- release-id: ${{ steps.create-release.outputs.id }}
- release-tag: ${{ steps.create-release.outputs.tag_name }}
- release-upload-url: ${{ steps.create-release.outputs.upload_url }}
- steps:
- - uses: actions/checkout@v4
- - name: Get version from package.json
- id: get-version
- run: |
- VERSION=$(node -p "require('./desktop-app/package.json').version")
- TIMESTAMP=$(date +%Y%m%d-%H%M%S)
- TAG="v${VERSION}-${TIMESTAMP}"
- echo "version=${VERSION}" >> $GITHUB_OUTPUT
- echo "tag=${TAG}" >> $GITHUB_OUTPUT
- - name: Create Release
- id: create-release
- uses: actions/create-release@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- tag_name: ${{ steps.get-version.outputs.tag }}
- release_name: kNotes Desktop v${{ steps.get-version.outputs.version }}
- body: |
- ## kNotes Desktop App - Automatic Release
- This release was automatically generated when frontend changes were detected.
- ### What's New:
- - Latest frontend updates from the web application
- - Automatic synchronization with deployed API
- - Bug fixes and improvements
- ### Downloads:
- - **Windows**: Download the `.exe` installer
- - **macOS**: Download the `.dmg` installer
- - **Linux**: Download the `.AppImage` file
- ### Installation:
- 1. Download the appropriate file for your operating system
- 2. Install/run the application
- 3. The app will automatically check for future updates
- Built from commit: ${{ github.sha }}
- draft: false
- prerelease: false
- build-linux:
- name: Build Linux
- needs: create-release
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - name: Setup Node.js
- uses: actions/setup-node@v4
- with:
- node-version: '18'
- cache: 'npm'
- cache-dependency-path: desktop-app/package-lock.json
- - name: Copy frontend files
- run: |
- cp -r src/main/resources/static/* desktop-app/
- - name: Install dependencies
- run: |
- cd desktop-app
- npm ci
- - name: Build and publish Linux
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- cd desktop-app
- npm run publish-linux
- build-windows:
- name: Build Windows
- needs: create-release
- runs-on: windows-latest
- steps:
- - uses: actions/checkout@v4
- - name: Setup Node.js
- uses: actions/setup-node@v4
- with:
- node-version: '18'
- cache: 'npm'
- cache-dependency-path: desktop-app/package-lock.json
- - name: Copy frontend files
- run: |
- xcopy "src\main\resources\static\*" "desktop-app\" /E /I /Y
- - name: Install dependencies
- run: |
- cd desktop-app
- npm ci
- - name: Build and publish Windows
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- cd desktop-app
- npm run publish-win
- build-macos:
- name: Build macOS
- needs: create-release
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v4
- - name: Setup Node.js
- uses: actions/setup-node@v4
- with:
- node-version: '18'
- cache: 'npm'
- cache-dependency-path: desktop-app/package-lock.json
- - name: Copy frontend files
- run: |
- cp -r src/main/resources/static/* desktop-app/
- - name: Install dependencies
- run: |
- cd desktop-app
- npm ci
- - name: Build and publish macOS
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- cd desktop-app
- npm run publish-mac
|