diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6ef6da7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,112 @@ +name: CI + +on: + push: + branches: [main] + tags: ['v*'] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + artifact: cagire-linux-x86_64 + - os: macos-13 + target: x86_64-apple-darwin + artifact: cagire-macos-x86_64 + - os: macos-14 + target: aarch64-apple-darwin + artifact: cagire-macos-aarch64 + - os: windows-latest + target: x86_64-pc-windows-msvc + artifact: cagire-windows-x86_64 + + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + + 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 (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y build-essential cmake pkg-config libasound2-dev libclang-dev + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: brew list cmake &>/dev/null || brew install cmake + + - name: Install dependencies (Windows) + if: runner.os == 'Windows' + 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 ${{ matrix.target }} + + - name: Run tests + run: cargo test --target ${{ matrix.target }} + + - name: Run clippy + run: cargo clippy --target ${{ matrix.target }} -- -D warnings + + - name: Upload artifact (Unix) + if: runner.os != 'Windows' + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: target/${{ matrix.target }}/release/cagire + + - name: Upload artifact (Windows) + if: runner.os == 'Windows' + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: target/${{ matrix.target }}/release/cagire.exe + + release: + needs: build + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + files: artifacts/**/* + generate_release_notes: true diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..c7bd42f --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,41 @@ +name: Deploy Website + +on: + push: + branches: [main] + paths: + - 'website/**' + - '.github/workflows/pages.yml' + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - uses: actions/checkout@v4 + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: website + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/website/index.html b/website/index.html index f5269d7..ec158ab 100644 --- a/website/index.html +++ b/website/index.html @@ -138,9 +138,10 @@ Releases - macOS - Windows - Linux + macOS (ARM) + macOS (Intel) + Windows + Linux @@ -153,7 +154,7 @@ Support - Report issues and contribute on GitHub. + Report issues and contribute on GitHub. Support the project on Ko-fi.
Report issues and contribute on GitHub.
Support the project on Ko-fi.