diff --git a/.github b/.github deleted file mode 120000 index c7309bdff..000000000 --- a/.github +++ /dev/null @@ -1 +0,0 @@ -/home/me/aesthetic-computer/modes \ No newline at end of file diff --git a/.github/workflows/electron-release.yml b/.github/workflows/electron-release.yml new file mode 100644 index 000000000..180889b74 --- /dev/null +++ b/.github/workflows/electron-release.yml @@ -0,0 +1,158 @@ +name: Build and Release Electron App + +on: + push: + tags: + - 'v*' + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g., 0.1.8)' + required: false + default: '' + +jobs: + build-macos: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: ac-electron/package-lock.json + + - name: Setup Python for node-gyp + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + working-directory: ac-electron + run: npm ci + + - name: Build macOS (universal) and publish + working-directory: ac-electron + run: npx electron-builder --mac --universal --publish always + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload macOS artifacts + uses: actions/upload-artifact@v4 + with: + name: macos-build + path: | + ac-electron/dist/*.dmg + ac-electron/dist/*.zip + ac-electron/dist/latest-mac.yml + retention-days: 5 + + build-windows: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: ac-electron/package-lock.json + + - name: Setup Python for node-gyp + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + working-directory: ac-electron + run: npm ci + + - name: Build Windows and publish + working-directory: ac-electron + run: npx electron-builder --win --x64 --publish always + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Windows artifacts + uses: actions/upload-artifact@v4 + with: + name: windows-build + path: | + ac-electron/dist/*.exe + ac-electron/dist/latest.yml + retention-days: 5 + + build-linux: + 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' + cache-dependency-path: ac-electron/package-lock.json + + - name: Setup Python for node-gyp + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install dependencies + working-directory: ac-electron + run: npm ci + + - name: Build Linux and publish + working-directory: ac-electron + run: npx electron-builder --linux --publish always + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Linux artifacts + uses: actions/upload-artifact@v4 + with: + name: linux-build + path: | + ac-electron/dist/*.AppImage + ac-electron/dist/*.deb + ac-electron/dist/*.rpm + ac-electron/dist/latest-linux.yml + retention-days: 5 + + release: + needs: [build-macos, build-windows, build-linux] + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + permissions: + contents: write + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: List artifacts + run: find artifacts -type f -name "*" + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: | + artifacts/macos-build/*.dmg + artifacts/macos-build/*.zip + artifacts/windows-build/*.exe + artifacts/linux-build/*.AppImage + artifacts/linux-build/*.deb + artifacts/linux-build/*.rpm + draft: false + prerelease: false + generate_release_notes: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}