From 539aa6a9f7b2532896801797443200adba5ac9a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Forment?= Date: Sat, 7 Mar 2026 14:23:28 +0100 Subject: [PATCH] Feat: move CI (GitHub - Gitea) --- .gitea/workflows/assemble-macos.yml | 135 +++++++++++++++++++++ .gitea/workflows/build-cross.yml | 49 ++++++++ .gitea/workflows/build-linux.yml | 131 ++++++++++++++++++++ .gitea/workflows/build-macos.yml | 127 +++++++++++++++++++ .gitea/workflows/build-plugins-linux.yml | 56 +++++++++ .gitea/workflows/build-plugins-macos.yml | 66 ++++++++++ .gitea/workflows/build-plugins-rpi.yml | 57 +++++++++ .gitea/workflows/build-plugins-windows.yml | 59 +++++++++ .gitea/workflows/build-plugins.yml | 17 +++ .gitea/workflows/build-windows.yml | 134 ++++++++++++++++++++ .gitea/workflows/ci.yml | 23 ++++ .gitea/workflows/release.yml | 111 +++++++++++++++++ 12 files changed, 965 insertions(+) create mode 100644 .gitea/workflows/assemble-macos.yml create mode 100644 .gitea/workflows/build-cross.yml create mode 100644 .gitea/workflows/build-linux.yml create mode 100644 .gitea/workflows/build-macos.yml create mode 100644 .gitea/workflows/build-plugins-linux.yml create mode 100644 .gitea/workflows/build-plugins-macos.yml create mode 100644 .gitea/workflows/build-plugins-rpi.yml create mode 100644 .gitea/workflows/build-plugins-windows.yml create mode 100644 .gitea/workflows/build-plugins.yml create mode 100644 .gitea/workflows/build-windows.yml create mode 100644 .gitea/workflows/ci.yml create mode 100644 .gitea/workflows/release.yml diff --git a/.gitea/workflows/assemble-macos.yml b/.gitea/workflows/assemble-macos.yml new file mode 100644 index 0000000..1cf2674 --- /dev/null +++ b/.gitea/workflows/assemble-macos.yml @@ -0,0 +1,135 @@ +name: Assemble macOS Universal + +on: + workflow_call: + +jobs: + assemble: + runs-on: macos-14 + timeout-minutes: 10 + + steps: + - name: Download macOS artifacts + uses: actions/download-artifact@v4 + with: + pattern: cagire-macos-* + path: artifacts + + - name: Create universal CLI binary + run: | + lipo -create \ + artifacts/cagire-macos-x86_64/cagire \ + artifacts/cagire-macos-aarch64/cagire \ + -output cagire + chmod +x cagire + lipo -info cagire + + - name: Create universal app bundle + run: | + cd artifacts/cagire-macos-aarch64-desktop + unzip Cagire.app.zip + cd ../cagire-macos-x86_64-desktop + unzip Cagire.app.zip + cd ../.. + cp -R artifacts/cagire-macos-aarch64-desktop/Cagire.app Cagire.app + lipo -create \ + artifacts/cagire-macos-x86_64-desktop/Cagire.app/Contents/MacOS/cagire-desktop \ + artifacts/cagire-macos-aarch64-desktop/Cagire.app/Contents/MacOS/cagire-desktop \ + -output Cagire.app/Contents/MacOS/cagire-desktop + lipo -info Cagire.app/Contents/MacOS/cagire-desktop + zip -r Cagire.app.zip Cagire.app + + - name: Create universal CLAP plugin + run: | + mkdir -p cagire-plugins.clap/Contents/MacOS + cp artifacts/cagire-macos-aarch64-clap/cagire-plugins.clap/Contents/Info.plist \ + cagire-plugins.clap/Contents/ 2>/dev/null || true + cp artifacts/cagire-macos-aarch64-clap/cagire-plugins.clap/Contents/PkgInfo \ + cagire-plugins.clap/Contents/ 2>/dev/null || true + lipo -create \ + artifacts/cagire-macos-x86_64-clap/cagire-plugins.clap/Contents/MacOS/cagire-plugins \ + artifacts/cagire-macos-aarch64-clap/cagire-plugins.clap/Contents/MacOS/cagire-plugins \ + -output cagire-plugins.clap/Contents/MacOS/cagire-plugins + lipo -info cagire-plugins.clap/Contents/MacOS/cagire-plugins + + - name: Create universal VST3 plugin + run: | + mkdir -p cagire-plugins.vst3/Contents/MacOS + cp -R artifacts/cagire-macos-aarch64-vst3/cagire-plugins.vst3/Contents/Info.plist \ + cagire-plugins.vst3/Contents/ 2>/dev/null || true + cp artifacts/cagire-macos-aarch64-vst3/cagire-plugins.vst3/Contents/PkgInfo \ + cagire-plugins.vst3/Contents/ 2>/dev/null || true + cp -R artifacts/cagire-macos-aarch64-vst3/cagire-plugins.vst3/Contents/Resources \ + cagire-plugins.vst3/Contents/ 2>/dev/null || true + lipo -create \ + artifacts/cagire-macos-x86_64-vst3/cagire-plugins.vst3/Contents/MacOS/cagire-plugins \ + artifacts/cagire-macos-aarch64-vst3/cagire-plugins.vst3/Contents/MacOS/cagire-plugins \ + -output cagire-plugins.vst3/Contents/MacOS/cagire-plugins + lipo -info cagire-plugins.vst3/Contents/MacOS/cagire-plugins + + - uses: actions/checkout@v4 + with: + sparse-checkout: | + assets/DMG-README.txt + scripts/make-dmg.sh + clean: false + + - name: Create DMG + run: | + chmod +x scripts/make-dmg.sh + scripts/make-dmg.sh Cagire.app . + + - name: Build .pkg installer + run: | + VERSION="${GITEA_REF_NAME#v}" + mkdir -p pkg-root/Applications pkg-root/usr/local/bin + cp -R Cagire.app pkg-root/Applications/ + cp cagire pkg-root/usr/local/bin/ + pkgbuild --analyze --root pkg-root component.plist + plutil -replace BundleIsRelocatable -bool NO component.plist + pkgbuild --root pkg-root --identifier com.sova.cagire \ + --version "$VERSION" --install-location / \ + --component-plist component.plist \ + "Cagire-${VERSION}-universal.pkg" + + - name: Upload universal CLI + uses: actions/upload-artifact@v4 + with: + name: cagire-macos-universal + path: cagire + + - name: Upload universal app bundle + uses: actions/upload-artifact@v4 + with: + name: cagire-macos-universal-desktop + path: Cagire.app.zip + + - name: Prepare universal plugin staging + run: | + mkdir -p staging/clap staging/vst3 + cp -R cagire-plugins.clap staging/clap/ + cp -R cagire-plugins.vst3 staging/vst3/ + + - name: Upload universal CLAP plugin + uses: actions/upload-artifact@v4 + with: + name: cagire-macos-universal-clap + path: staging/clap/ + + - name: Upload universal VST3 plugin + uses: actions/upload-artifact@v4 + with: + name: cagire-macos-universal-vst3 + path: staging/vst3/ + + - name: Upload DMG + uses: actions/upload-artifact@v4 + with: + name: cagire-macos-universal-dmg + path: Cagire-*.dmg + + - name: Upload .pkg installer + uses: actions/upload-artifact@v4 + with: + name: cagire-macos-universal-pkg + path: Cagire-*-universal.pkg diff --git a/.gitea/workflows/build-cross.yml b/.gitea/workflows/build-cross.yml new file mode 100644 index 0000000..26d3b67 --- /dev/null +++ b/.gitea/workflows/build-cross.yml @@ -0,0 +1,49 @@ +name: Build Cross (Linux ARM64) + +on: + workflow_call: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-unknown-linux-gnu + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: aarch64-unknown-linux-gnu + + - name: Install cross + run: cargo install cross --git https://github.com/cross-rs/cross + + - name: Build + run: cross build --release --target aarch64-unknown-linux-gnu + + - name: Build desktop + run: cross build --release --features desktop --bin cagire-desktop --target aarch64-unknown-linux-gnu + + - name: Upload CLI artifact + uses: actions/upload-artifact@v4 + with: + name: cagire-linux-aarch64 + path: target/aarch64-unknown-linux-gnu/release/cagire + + - name: Upload desktop artifact + uses: actions/upload-artifact@v4 + with: + name: cagire-linux-aarch64-desktop + path: target/aarch64-unknown-linux-gnu/release/cagire-desktop diff --git a/.gitea/workflows/build-linux.yml b/.gitea/workflows/build-linux.yml new file mode 100644 index 0000000..c8449ad --- /dev/null +++ b/.gitea/workflows/build-linux.yml @@ -0,0 +1,131 @@ +name: Build Linux + +on: + workflow_call: + inputs: + run-tests: + type: boolean + default: false + run-clippy: + type: boolean + default: false + build-packages: + type: boolean + default: false + workflow_dispatch: + inputs: + run-tests: + type: boolean + default: true + run-clippy: + type: boolean + default: true + build-packages: + type: boolean + default: false + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-gnu + components: clippy + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: x86_64-unknown-linux-gnu + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake pkg-config libasound2-dev libclang-dev libjack-dev \ + libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libgl1-mesa-dev \ + libx11-dev libx11-xcb-dev libxcursor-dev libxrandr-dev libxi-dev libwayland-dev + + - name: Build + run: cargo build --release --target x86_64-unknown-linux-gnu + + - name: Build desktop + run: cargo build --release --features desktop --bin cagire-desktop --target x86_64-unknown-linux-gnu + + - name: Test + if: inputs.run-tests + run: cargo test --target x86_64-unknown-linux-gnu + + - name: Clippy + if: inputs.run-clippy + run: cargo clippy --target x86_64-unknown-linux-gnu -- -D warnings + + - name: Install cargo-bundle + if: inputs.build-packages + run: cargo install cargo-bundle + + - name: Bundle desktop app + if: inputs.build-packages + run: cargo bundle --release --features desktop --bin cagire-desktop --target x86_64-unknown-linux-gnu + + - name: Build AppImages + if: inputs.build-packages + run: | + mkdir -p target/releases + scripts/make-appimage.sh target/x86_64-unknown-linux-gnu/release/cagire x86_64 target/releases + scripts/make-appimage.sh target/x86_64-unknown-linux-gnu/release/cagire-desktop x86_64 target/releases + + - name: Bundle CLAP plugin + if: inputs.build-packages + run: cargo xtask bundle cagire-plugins --release --target x86_64-unknown-linux-gnu + + - name: Upload CLI artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-linux-x86_64 + path: target/x86_64-unknown-linux-gnu/release/cagire + + - name: Upload desktop artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-linux-x86_64-desktop + path: target/x86_64-unknown-linux-gnu/release/bundle/deb/*.deb + + - name: Upload AppImage artifacts + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-linux-x86_64-appimage + path: target/releases/*.AppImage + + - name: Prepare plugin artifacts + if: inputs.build-packages + run: | + mkdir -p staging/clap staging/vst3 + cp -R target/bundled/cagire-plugins.clap staging/clap/ + cp -R target/bundled/cagire-plugins.vst3 staging/vst3/ + + - name: Upload CLAP artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-linux-x86_64-clap + path: staging/clap/ + + - name: Upload VST3 artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-linux-x86_64-vst3 + path: staging/vst3/ diff --git a/.gitea/workflows/build-macos.yml b/.gitea/workflows/build-macos.yml new file mode 100644 index 0000000..e7d738a --- /dev/null +++ b/.gitea/workflows/build-macos.yml @@ -0,0 +1,127 @@ +name: Build macOS + +on: + workflow_call: + inputs: + run-tests: + type: boolean + default: false + run-clippy: + type: boolean + default: false + build-packages: + type: boolean + default: false + matrix: + type: string + default: '[{"os":"macos-14","target":"aarch64-apple-darwin","artifact":"cagire-macos-aarch64"}]' + workflow_dispatch: + inputs: + run-tests: + type: boolean + default: true + run-clippy: + type: boolean + default: true + build-packages: + type: boolean + default: false + matrix: + type: string + default: '[{"os":"macos-14","target":"aarch64-apple-darwin","artifact":"cagire-macos-aarch64"}]' + +env: + CARGO_TERM_COLOR: always + MACOSX_DEPLOYMENT_TARGET: "12.0" + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(inputs.matrix) }} + + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + components: clippy + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} + + - name: Install dependencies + run: brew list cmake &>/dev/null || brew install cmake + + - name: Build + run: cargo build --release --target ${{ matrix.target }} + + - name: Build desktop + run: cargo build --release --features desktop --bin cagire-desktop --target ${{ matrix.target }} + + - name: Test + if: inputs.run-tests + run: cargo test --target ${{ matrix.target }} + + - name: Clippy + if: inputs.run-clippy + run: cargo clippy --target ${{ matrix.target }} -- -D warnings + + - name: Bundle desktop app + if: inputs.build-packages + run: scripts/make-app-bundle.sh ${{ matrix.target }} + + - name: Bundle CLAP plugin + if: inputs.build-packages + run: cargo xtask bundle cagire-plugins --release --target ${{ matrix.target }} + + - name: Zip macOS app bundle + if: inputs.build-packages + run: | + cd target/${{ matrix.target }}/release/bundle/osx + zip -r Cagire.app.zip Cagire.app + + - name: Upload CLI artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: target/${{ matrix.target }}/release/cagire + + - name: Upload desktop artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }}-desktop + path: target/${{ matrix.target }}/release/bundle/osx/Cagire.app.zip + + - name: Prepare plugin artifacts + if: inputs.build-packages + run: | + mkdir -p staging/clap staging/vst3 + cp -R target/bundled/cagire-plugins.clap staging/clap/ + cp -R target/bundled/cagire-plugins.vst3 staging/vst3/ + + - name: Upload CLAP artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }}-clap + path: staging/clap/ + + - name: Upload VST3 artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }}-vst3 + path: staging/vst3/ diff --git a/.gitea/workflows/build-plugins-linux.yml b/.gitea/workflows/build-plugins-linux.yml new file mode 100644 index 0000000..50ec0a4 --- /dev/null +++ b/.gitea/workflows/build-plugins-linux.yml @@ -0,0 +1,56 @@ +name: Build Plugins Linux + +on: + workflow_call: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-unknown-linux-gnu + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: x86_64-unknown-linux-gnu-plugins + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake pkg-config libasound2-dev libclang-dev libjack-dev \ + libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libgl1-mesa-dev \ + libx11-dev libx11-xcb-dev libxcursor-dev libxrandr-dev libxi-dev libwayland-dev + + - name: Build plugins + run: cargo xtask bundle cagire-plugins --release --target x86_64-unknown-linux-gnu + + - name: Prepare plugin artifacts + run: | + mkdir -p staging/clap staging/vst3 + cp -R target/bundled/cagire-plugins.clap staging/clap/ + cp -R target/bundled/cagire-plugins.vst3 staging/vst3/ + + - name: Upload CLAP artifact + uses: actions/upload-artifact@v4 + with: + name: plugins-linux-x86_64-clap + path: staging/clap/ + + - name: Upload VST3 artifact + uses: actions/upload-artifact@v4 + with: + name: plugins-linux-x86_64-vst3 + path: staging/vst3/ diff --git a/.gitea/workflows/build-plugins-macos.yml b/.gitea/workflows/build-plugins-macos.yml new file mode 100644 index 0000000..8b46fe8 --- /dev/null +++ b/.gitea/workflows/build-plugins-macos.yml @@ -0,0 +1,66 @@ +name: Build Plugins macOS + +on: + workflow_call: + inputs: + matrix: + type: string + default: '[{"os":"macos-14","target":"aarch64-apple-darwin","artifact":"plugins-macos-aarch64"},{"os":"macos-15-intel","target":"x86_64-apple-darwin","artifact":"plugins-macos-x86_64"}]' + workflow_dispatch: + inputs: + matrix: + type: string + default: '[{"os":"macos-14","target":"aarch64-apple-darwin","artifact":"plugins-macos-aarch64"}]' + +env: + CARGO_TERM_COLOR: always + MACOSX_DEPLOYMENT_TARGET: "12.0" + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON(inputs.matrix) }} + + runs-on: ${{ matrix.os }} + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }}-plugins + + - name: Install dependencies + run: brew list cmake &>/dev/null || brew install cmake + + - name: Build plugins + run: cargo xtask bundle cagire-plugins --release --target ${{ matrix.target }} + + - name: Prepare plugin artifacts + run: | + mkdir -p staging/clap staging/vst3 + cp -R target/bundled/cagire-plugins.clap staging/clap/ + cp -R target/bundled/cagire-plugins.vst3 staging/vst3/ + + - name: Upload CLAP artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }}-clap + path: staging/clap/ + + - name: Upload VST3 artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }}-vst3 + path: staging/vst3/ diff --git a/.gitea/workflows/build-plugins-rpi.yml b/.gitea/workflows/build-plugins-rpi.yml new file mode 100644 index 0000000..6382767 --- /dev/null +++ b/.gitea/workflows/build-plugins-rpi.yml @@ -0,0 +1,57 @@ +name: Build Plugins RPi + +on: + workflow_call: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-unknown-linux-gnu + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: aarch64-unknown-linux-gnu-plugins + + - name: Install cross + run: cargo install cross --git https://github.com/cross-rs/cross + + - name: Build plugins + run: cross build --release -p cagire-plugins --target aarch64-unknown-linux-gnu + + - name: Prepare plugin artifacts + run: | + mkdir -p target/bundled + cp target/aarch64-unknown-linux-gnu/release/libcagire_plugins.so target/bundled/cagire-plugins.clap + mkdir -p "target/bundled/cagire-plugins.vst3/Contents/aarch64-linux" + cp target/aarch64-unknown-linux-gnu/release/libcagire_plugins.so "target/bundled/cagire-plugins.vst3/Contents/aarch64-linux/cagire-plugins.so" + + mkdir -p staging/clap staging/vst3 + cp -R target/bundled/cagire-plugins.clap staging/clap/ + cp -R target/bundled/cagire-plugins.vst3 staging/vst3/ + + - name: Upload CLAP artifact + uses: actions/upload-artifact@v4 + with: + name: plugins-linux-aarch64-clap + path: staging/clap/ + + - name: Upload VST3 artifact + uses: actions/upload-artifact@v4 + with: + name: plugins-linux-aarch64-vst3 + path: staging/vst3/ diff --git a/.gitea/workflows/build-plugins-windows.yml b/.gitea/workflows/build-plugins-windows.yml new file mode 100644 index 0000000..2890daa --- /dev/null +++ b/.gitea/workflows/build-plugins-windows.yml @@ -0,0 +1,59 @@ +name: Build Plugins Windows + +on: + workflow_call: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: windows-latest + timeout-minutes: 60 + + defaults: + run: + shell: bash + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: x86_64-pc-windows-msvc-plugins + + - name: Install dependencies + shell: pwsh + run: | + choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' + echo "C:\Program Files\CMake\bin" >> $env:GITHUB_PATH + + - name: Build plugins + run: cargo xtask bundle cagire-plugins --release --target x86_64-pc-windows-msvc + + - name: Prepare plugin artifacts + run: | + mkdir -p staging/clap staging/vst3 + cp -R target/bundled/cagire-plugins.clap staging/clap/ + cp -R target/bundled/cagire-plugins.vst3 staging/vst3/ + + - name: Upload CLAP artifact + uses: actions/upload-artifact@v4 + with: + name: plugins-windows-x86_64-clap + path: staging/clap/ + + - name: Upload VST3 artifact + uses: actions/upload-artifact@v4 + with: + name: plugins-windows-x86_64-vst3 + path: staging/vst3/ diff --git a/.gitea/workflows/build-plugins.yml b/.gitea/workflows/build-plugins.yml new file mode 100644 index 0000000..878213d --- /dev/null +++ b/.gitea/workflows/build-plugins.yml @@ -0,0 +1,17 @@ +name: Build Plugins + +on: + workflow_dispatch: + +jobs: + linux: + uses: ./.gitea/workflows/build-plugins-linux.yml + + macos: + uses: ./.gitea/workflows/build-plugins-macos.yml + + windows: + uses: ./.gitea/workflows/build-plugins-windows.yml + + rpi: + uses: ./.gitea/workflows/build-plugins-rpi.yml diff --git a/.gitea/workflows/build-windows.yml b/.gitea/workflows/build-windows.yml new file mode 100644 index 0000000..9aa25e1 --- /dev/null +++ b/.gitea/workflows/build-windows.yml @@ -0,0 +1,134 @@ +name: Build Windows + +on: + workflow_call: + inputs: + run-tests: + type: boolean + default: false + run-clippy: + type: boolean + default: false + build-packages: + type: boolean + default: false + workflow_dispatch: + inputs: + run-tests: + type: boolean + default: true + run-clippy: + type: boolean + default: true + build-packages: + type: boolean + default: true + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: windows-latest + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: x86_64-pc-windows-msvc + components: clippy + + - name: Cache Rust dependencies + uses: Swatinem/rust-cache@v2 + with: + key: x86_64-pc-windows-msvc + + - name: Install dependencies + run: | + choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' + echo "C:\Program Files\CMake\bin" >> $env:GITHUB_PATH + + - name: Build + run: cargo build --release --target x86_64-pc-windows-msvc + + - name: Build desktop + run: cargo build --release --features desktop --bin cagire-desktop --target x86_64-pc-windows-msvc + + - name: Test + if: inputs.run-tests + run: cargo test --target x86_64-pc-windows-msvc + + - name: Clippy + if: inputs.run-clippy + run: cargo clippy --target x86_64-pc-windows-msvc -- -D warnings + + - name: Bundle CLAP plugin + if: inputs.build-packages + run: cargo xtask bundle cagire-plugins --release --target x86_64-pc-windows-msvc + + - name: Install NSIS + if: inputs.build-packages + run: choco install nsis + + - name: Build NSIS installer + if: inputs.build-packages + shell: pwsh + run: | + $version = (Select-String -Path Cargo.toml -Pattern '^version\s*=\s*"(.+)"' | Select-Object -First 1).Matches.Groups[1].Value + $root = (Get-Location).Path + $target = "x86_64-pc-windows-msvc" + & "C:\Program Files (x86)\NSIS\makensis.exe" ` + "-DVERSION=$version" ` + "-DCLI_EXE=$root\target\$target\release\cagire.exe" ` + "-DDESKTOP_EXE=$root\target\$target\release\cagire-desktop.exe" ` + "-DICON=$root\assets\Cagire.ico" ` + "-DOUTDIR=$root\target" ` + nsis/cagire.nsi + + - name: Upload CLI artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-windows-x86_64 + path: target/x86_64-pc-windows-msvc/release/cagire.exe + + - name: Upload desktop artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-windows-x86_64-desktop + path: target/x86_64-pc-windows-msvc/release/cagire-desktop.exe + + - name: Upload installer artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-windows-x86_64-installer + path: target/cagire-*-setup.exe + + - name: Prepare plugin artifacts + if: inputs.build-packages + shell: bash + run: | + mkdir -p staging/clap staging/vst3 + cp -R target/bundled/cagire-plugins.clap staging/clap/ + cp -R target/bundled/cagire-plugins.vst3 staging/vst3/ + + - name: Upload CLAP artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-windows-x86_64-clap + path: staging/clap/ + + - name: Upload VST3 artifact + if: inputs.build-packages + uses: actions/upload-artifact@v4 + with: + name: cagire-windows-x86_64-vst3 + path: staging/vst3/ diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..f7d7ae7 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + workflow_dispatch: + +jobs: + linux: + uses: ./.gitea/workflows/build-linux.yml + with: + run-tests: true + run-clippy: true + + macos: + uses: ./.gitea/workflows/build-macos.yml + with: + run-tests: true + run-clippy: true + + windows: + uses: ./.gitea/workflows/build-windows.yml + with: + run-tests: true + run-clippy: true diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..fa17a8b --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,111 @@ +name: Release + +on: + workflow_dispatch: + +jobs: + linux: + uses: ./.gitea/workflows/build-linux.yml + with: + build-packages: true + + macos: + uses: ./.gitea/workflows/build-macos.yml + with: + build-packages: true + matrix: >- + [ + {"os":"macos-14","target":"aarch64-apple-darwin","artifact":"cagire-macos-aarch64"}, + {"os":"macos-15-intel","target":"x86_64-apple-darwin","artifact":"cagire-macos-x86_64"} + ] + + windows: + uses: ./.gitea/workflows/build-windows.yml + with: + build-packages: true + + cross: + uses: ./.gitea/workflows/build-cross.yml + + assemble-macos: + needs: macos + uses: ./.gitea/workflows/assemble-macos.yml + + release: + needs: [linux, macos, windows, cross, assemble-macos] + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Prepare release files + run: | + mkdir -p release + for dir in artifacts/*/; do + name=$(basename "$dir") + if [[ "$name" == "cagire-macos-universal-dmg" ]]; then + cp "$dir"/*.dmg release/ + elif [[ "$name" == "cagire-macos-universal-pkg" ]]; then + cp "$dir"/*.pkg release/ + elif [[ "$name" == "cagire-macos-universal-desktop" ]]; then + cp "$dir/Cagire.app.zip" "release/cagire-macos-universal-desktop.app.zip" + elif [[ "$name" == "cagire-macos-universal" ]]; then + cp "$dir/cagire" "release/cagire-macos-universal" + elif [[ "$name" == "cagire-macos-universal-clap" ]]; then + cd "$dir" && zip -r "../../release/cagire-macos-universal-clap.zip" cagire-plugins.clap && cd ../.. + elif [[ "$name" == "cagire-macos-universal-vst3" ]]; then + cd "$dir" && zip -r "../../release/cagire-macos-universal-vst3.zip" cagire-plugins.vst3 && cd ../.. + elif [[ "$name" == *-clap ]]; then + base="${name%-clap}" + cd "$dir" && zip -r "../../release/${base}-clap.zip" cagire-plugins.clap && cd ../.. + elif [[ "$name" == *-vst3 ]]; then + base="${name%-vst3}" + cd "$dir" && zip -r "../../release/${base}-vst3.zip" cagire-plugins.vst3 && cd ../.. + elif [[ "$name" == *-installer ]]; then + cp "$dir"/*-setup.exe release/ + elif [[ "$name" == *-appimage ]]; then + cp "$dir"/*.AppImage release/ + elif [[ "$name" == *-desktop ]]; then + base="${name%-desktop}" + if ls "$dir"/*.deb 1>/dev/null 2>&1; then + cp "$dir"/*.deb "release/${base}-desktop.deb" + elif [ -f "$dir/Cagire.app.zip" ]; then + cp "$dir/Cagire.app.zip" "release/${base}-desktop.app.zip" + elif [ -f "$dir/cagire-desktop.exe" ]; then + cp "$dir/cagire-desktop.exe" "release/${base}-desktop.exe" + fi + else + if [ -f "$dir/cagire.exe" ]; then + cp "$dir/cagire.exe" "release/${name}.exe" + elif [ -f "$dir/cagire" ]; then + cp "$dir/cagire" "release/${name}" + fi + fi + done + + - name: Create Gitea release + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + TAG="${GITEA_REF_NAME:-manual-$(date +%Y%m%d-%H%M%S)}" + API_URL="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}/releases" + + RELEASE_ID=$(curl -s -X POST "$API_URL" \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\": \"$TAG\", \"name\": \"$TAG\", \"draft\": true}" \ + | jq -r '.id') + + for file in release/*; do + filename=$(basename "$file") + curl -s -X POST "$API_URL/$RELEASE_ID/assets?name=$filename" \ + -H "Authorization: token $GITEA_TOKEN" \ + -H "Content-Type: application/octet-stream" \ + --data-binary "@$file" + done + + echo "Release $TAG created as draft with $(ls release | wc -l) assets"