diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..652317211 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,52 @@ +name: Build + +on: + push: + +env: + VITE_WEB_URL: ${{ vars.VITE_WEB_URL }} + VITE_API_URL: ${{ vars.VITE_API_URL }} + VITE_IMGPROXY_URL: ${{ vars.VITE_IMGPROXY_URL }} + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Cache pnpm modules + uses: actions/cache@v4 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}- + + - name: Setup pnpm + uses: pnpm/action-setup@v3.0.0 + with: + version: latest + run_install: true + + - name: Use Node.js 22.x + uses: actions/setup-node@v4.0.2 + with: + node-version: 22.x + cache: "pnpm" + + - name: Build/release Electron app + uses: samuelmeuli/action-electron-builder@v1 + with: + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + github_token: ${{ secrets.GITHUB_TOKEN }} + + # If the commit is tagged with a version (e.g. "v1.0.0"), + # release the app after building + release: ${{ startsWith(github.ref, 'refs/tags/v') }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 4ae6aa655..000000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build Nightly - -on: - push: - -env: - VITE_WEB_URL: ${{ vars.VITE_WEB_URL }} - VITE_API_URL: ${{ vars.VITE_API_URL }} - VITE_IMGPROXY_URL: ${{ vars.VITE_IMGPROXY_URL }} - -jobs: - build: - runs-on: macos-latest - name: Build - steps: - - uses: actions/checkout@v4 - - name: Cache pnpm modules - uses: actions/cache@v4 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}- - - uses: pnpm/action-setup@v3.0.0 - with: - version: latest - run_install: true - - name: Use Node.js 22.x - uses: actions/setup-node@v4.0.2 - with: - node-version: 22.x - cache: "pnpm" - - name: Build for Mac - run: pnpm build:mac - - name: Upload file - uses: actions/upload-artifact@v4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - path: "dist/*.dmg" - retention-days: 90