mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-09 03:14:20 +01:00
So we don't have to wait for the whole matrix to start building individual packages per OS Signed-off-by: William Casarin <jb55@jb55.com>
209 lines
5.7 KiB
YAML
209 lines
5.7 KiB
YAML
on: [pull_request]
|
|
|
|
name: CI
|
|
|
|
jobs:
|
|
fmt:
|
|
name: Rustfmt
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: rustfmt
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: fmt
|
|
args: --all -- --check
|
|
|
|
clippy:
|
|
name: Clippy
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: clippy
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
- uses: actions-rs/cargo@v1
|
|
with:
|
|
command: clippy
|
|
args: -- -D warnings
|
|
|
|
linux-build-test:
|
|
name: Build and Test (Linux)
|
|
uses: ./.github/workflows/build-and-test.yml
|
|
with:
|
|
os: ubuntu-latest
|
|
upload-artifact-name: notedeck-linux-bin
|
|
upload-artifact-path: target/release/notedeck
|
|
additional-setup: |
|
|
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
|
|
|
|
macos-build-test:
|
|
name: Build and Test (macOS)
|
|
uses: ./.github/workflows/build-and-test.yml
|
|
with:
|
|
os: macos-latest
|
|
upload-artifact-name: notedeck-macos-bin
|
|
upload-artifact-path: target/release/notedeck
|
|
|
|
windows-build-test:
|
|
name: Build and Test (Windows)
|
|
uses: ./.github/workflows/build-and-test.yml
|
|
with:
|
|
os: windows-latest
|
|
upload-artifact-name: notedeck.exe
|
|
upload-artifact-path: target/release/notedeck.exe
|
|
|
|
packaging:
|
|
name: Build Linux Packages
|
|
runs-on: ubuntu-latest
|
|
needs: linux-build-test
|
|
steps:
|
|
# Checkout the repository
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
|
|
# Install Packaging Tools
|
|
- name: Install Packaging Tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y rpm binutils
|
|
cargo install cargo-generate-rpm cargo-deb
|
|
|
|
- name: Download Build Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: notedeck-linux-bin # Assuming you need the Release build
|
|
path: target/release
|
|
|
|
# Cache
|
|
- name: Rust cache
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
# Build Packages
|
|
- name: Build Packages
|
|
run: |
|
|
cargo generate-rpm
|
|
cargo deb
|
|
|
|
# Upload RPM Package
|
|
- name: Upload RPM Package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: notedeck.rpm
|
|
path: target/generate-rpm/*.rpm
|
|
|
|
# Upload Debian Package
|
|
- name: Upload Debian Package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: notedeck.deb
|
|
path: target/debian/*.deb
|
|
|
|
macos-dmg:
|
|
name: Build macOS DMG
|
|
runs-on: macos-latest
|
|
needs: macos-build-test
|
|
env:
|
|
NOTEDECK_APPLE_RELEASE_CERT_ID: ${{ secrets.NOTEDECK_APPLE_RELEASE_CERT_ID }}
|
|
NOTEDECK_RELEASE_APPLE_ID: ${{ secrets.NOTEDECK_RELEASE_APPLE_ID }}
|
|
NOTEDECK_APPLE_APP_SPECIFIC_PW: ${{ secrets.NOTEDECK_APPLE_APP_SPECIFIC_PW }}
|
|
NOTEDECK_APPLE_TEAM_ID: ${{ secrets.NOTEDECK_APPLE_TEAM_ID }}
|
|
steps:
|
|
# Checkout the repository
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
|
|
# Set up Rust
|
|
- name: Setup Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
|
|
# create-dmg and cargo-bundle caching
|
|
- name: Rust cache
|
|
uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Download Build Artifacts (MacOS)
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: notedeck-macos-bin # Assuming you need the Release build
|
|
path: target/release
|
|
|
|
- name: Install Required Tools
|
|
run: |
|
|
brew install create-dmg
|
|
cargo install cargo-bundle
|
|
|
|
- name: Import apple codesign cert
|
|
uses: apple-actions/import-codesign-certs@v3
|
|
with:
|
|
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
|
|
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
|
|
|
|
- name: Run macOS DMG Build Script
|
|
run: ./scripts/macos_build.sh
|
|
|
|
- name: Upload DMG Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: notedeck.dmg
|
|
path: packages/notedeck.dmg
|
|
|
|
windows-installer:
|
|
name: Build Windows Installer
|
|
runs-on: windows-latest
|
|
needs: windows-build-test
|
|
steps:
|
|
# Checkout the repository
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Download Build Artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: notedeck.exe # Assuming you need the Release build
|
|
path: target/release
|
|
|
|
# Create packages directory
|
|
- name: Create packages directory
|
|
run: mkdir packages
|
|
|
|
# Install Inno Setup
|
|
- name: Install Inno Setup
|
|
run: choco install innosetup --no-progress --yes
|
|
|
|
# Validate executable exists
|
|
- name: Validate required files
|
|
run: |
|
|
if (!(Test-Path -Path target\release\notedeck.exe)) {
|
|
throw "Executable 'notedeck.exe' not found in 'target/release'."
|
|
}
|
|
|
|
# Build Installer
|
|
- name: Run Inno Setup Script
|
|
run: |
|
|
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "scripts\windows-installer.iss"
|
|
|
|
# List outputs
|
|
- name: List Inno Script outputs
|
|
run: dir packages
|
|
|
|
# Upload the installer as an artifact
|
|
- name: Upload Installer
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: DamusNotedeckInstaller.exe
|
|
path: packages\DamusNotedeckInstaller.exe
|