wip cross build #692
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- ci | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- run: cargo clippy -- -D warnings | |
linux-test: | |
name: Test (Linux) | |
uses: ./.github/workflows/build-and-test.yml | |
with: | |
os: ubuntu-latest | |
additional-setup: | | |
sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev | |
macos-test: | |
name: Test (macOS) | |
uses: ./.github/workflows/build-and-test.yml | |
with: | |
os: macos-latest | |
windows-test: | |
name: Test (Windows) | |
uses: ./.github/workflows/build-and-test.yml | |
with: | |
os: windows-latest | |
packaging: | |
name: rpm/deb | |
runs-on: ubuntu-latest | |
needs: linux-test | |
#if: github.ref_name == 'master' | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, aarch64] | |
steps: | |
# Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Install Packaging Tools | |
- name: Install Packaging Tools | |
run: | | |
sudo apt-get update | |
if [ "${{ matrix.arch }}" = "x86_64" ]; then | |
sudo apt-get install -y gcc-aarch64-linux-gnu | |
else | |
sudo apt-get install -y gcc-x86_64-linux-gnu | |
fi | |
cargo install cargo-generate-rpm cargo-deb | |
rustup target add ${{ matrix.arch }}-unknown-linux-gnu | |
# Build | |
- name: Build (${{ matrix.arch }}) | |
run: | | |
cargo build --release --target=${{ matrix.arch }}-unknown-linux-gnu | |
# Build RPM Package | |
- name: Build RPM Package | |
run: | | |
cargo generate-rpm --target=${{ matrix.arch }}-unknown-linux-gnu | |
# Build Debian Package | |
- name: Build Debian Package | |
run: | | |
cargo deb --target=${{ matrix.arch }}-unknown-linux-gnu | |
# Upload RPM Package | |
- name: Upload RPM Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ inputs.artifact-name }}-${{ matrix.arch }}.rpm | |
path: target/${{ matrix.arch }}-unknown-linux-gnu/generate-rpm/*.rpm | |
# Upload Debian Package | |
- name: Upload Debian Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ inputs.artifact-name }}-${{ inputs.arch }}.deb | |
path: target/${{ matrix.arch }}-unknown-linux-gnu/debian/*.deb | |
macos-dmg: | |
name: macOS dmg | |
runs-on: macos-latest | |
needs: macos-test | |
#if: github.ref_name == 'master' | |
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 }} | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x86_64, aarch64] | |
steps: | |
# Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install Required Tools | |
run: | | |
brew install create-dmg | |
cargo install cargo-bundle | |
rustup target add ${{ matrix.arch }}-apple-darwin | |
- 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: ARCH=${{ matrix.arch }} ./scripts/macos_build.sh | |
- name: Upload DMG Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: notedeck-${{ matrix.arch }}.dmg | |
path: packages/notedeck-${{ matrix.arch }}.dmg | |
windows-installer: | |
name: Build Windows Installer | |
runs-on: windows-latest | |
needs: windows-test | |
if: github.ref_name == 'master' | |
steps: | |
# Checkout the repository | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
# Create packages directory | |
- name: Create packages directory | |
run: mkdir packages | |
# Install Inno Setup | |
- name: Install Inno Setup | |
run: choco install innosetup --no-progress --yes | |
# 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 | |