mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-01-28 14:22:49 -05:00
136 lines
4.3 KiB
YAML
136 lines
4.3 KiB
YAML
name: 'Build and Release CreamLinux'
|
|
|
|
on:
|
|
push:
|
|
branches: ['main']
|
|
pull_request:
|
|
branches: ['main']
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
jobs:
|
|
build-and-release:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # Required for semantic-release
|
|
|
|
- name: Set up semantic-release environment
|
|
run: |
|
|
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
|
|
# More environment setup for release if needed
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm ci
|
|
|
|
- name: Run ESLint
|
|
run: npm run lint
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Cache Rust dependencies
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: 'src-tauri -> target'
|
|
cache-on-failure: true
|
|
|
|
# Setup platform-specific dependencies
|
|
- name: Install Linux dependencies
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: Install macOS dependencies
|
|
if: matrix.platform == 'macos-latest'
|
|
run: |
|
|
rustup target add aarch64-apple-darwin
|
|
|
|
- name: Install Windows dependencies
|
|
if: matrix.platform == 'windows-latest'
|
|
run: |
|
|
# Windows typically doesn't need additional dependencies
|
|
|
|
# Sync package version
|
|
- name: Sync Version
|
|
run: npm run sync-version
|
|
|
|
# Run semantic-release only on the ubuntu runner to avoid conflicts
|
|
- name: Semantic Release
|
|
if: matrix.platform == 'ubuntu-latest' && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
run: npx semantic-release
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# Build the app with updater artifacts
|
|
- name: Build the app
|
|
run: npm run tauri build
|
|
|
|
# Upload the artifacts for each platform
|
|
- name: Upload Linux artifacts
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: creamlinux-linux
|
|
path: |
|
|
src-tauri/target/release/bundle/deb/*.deb
|
|
src-tauri/target/release/bundle/appimage/*.AppImage
|
|
src-tauri/target/release/bundle/appimage/*.AppImage.sig
|
|
|
|
- name: Upload macOS artifacts
|
|
if: matrix.platform == 'macos-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: creamlinux-macos
|
|
path: |
|
|
src-tauri/target/release/bundle/macos/*.app
|
|
src-tauri/target/release/bundle/macos/*.app.tar.gz
|
|
src-tauri/target/release/bundle/macos/*.app.tar.gz.sig
|
|
src-tauri/target/release/bundle/dmg/*.dmg
|
|
|
|
- name: Upload Windows artifacts
|
|
if: matrix.platform == 'windows-latest'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: creamlinux-windows
|
|
path: |
|
|
src-tauri/target/release/bundle/msi/*.msi
|
|
src-tauri/target/release/bundle/msi/*.msi.sig
|
|
src-tauri/target/release/bundle/nsis/*.exe
|
|
src-tauri/target/release/bundle/nsis/*.exe.sig
|
|
|
|
# Generate updater JSON file (run only on ubuntu)
|
|
- name: Generate updater JSON
|
|
if: matrix.platform == 'ubuntu-latest' && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
run: |
|
|
node scripts/generate-updater-json.js
|
|
|
|
# Create GitHub release with all artifacts
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
if: matrix.platform == 'ubuntu-latest' && github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
with:
|
|
files: |
|
|
latest.json
|
|
src-tauri/target/release/bundle/**/*.{AppImage,AppImage.sig,deb,dmg,app.tar.gz,app.tar.gz.sig,msi,msi.sig,exe,exe.sig}
|
|
draft: false
|
|
prerelease: false
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
generate_release_notes: true
|