From d7fcafd2348a6e7f231c45b8af8d6270218cffc1 Mon Sep 17 00:00:00 2001 From: kelpsyberry <138107494+kelpsyberry@users.noreply.github.com> Date: Thu, 4 Jan 2024 19:07:55 +0100 Subject: [PATCH] Update workflows, add macOS AArch64 build --- .github/workflows/build-release.yml | 67 +++++++++++++++++------ .github/workflows/deploy-web.yml | 21 ++++--- .github/workflows/run-clippy-and-test.yml | 14 ++--- 3 files changed, 67 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index a08427d..342e0bb 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -21,32 +21,42 @@ jobs: - os: windows-latest artifact: Windows artifact-extension: .exe + target: x86_64-pc-windows-msvc - os: ubuntu-latest artifact: Linux + target: x86_64-unknown-linux-gnu - os: macos-latest - artifact: macOS + artifact: macOS-x86_64 + target: x86_64-apple-darwin + - os: macos-latest + artifact: macOS-aarch64 + target: aarch64-apple-darwin runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@v1 with: toolchain: nightly - override: true - components: clippy + target: ${{ matrix.target }} - - name: Cache dependencies and build directory - uses: actions/cache@v2 + - name: Cache Cargo registry + uses: actions/cache@v3 with: path: | ~/.cargo/bin ~/.cargo/registry/index ~/.cargo/registry/cache ~/.cargo/git/db - target/ - key: ${{ matrix.os }}-release + key: cargo-registry + + - name: Cache build directory + uses: actions/cache@v3 + with: + path: target/ + key: ${{ matrix.target }}-release - name: Install GTK and ALSA if: ${{ matrix.os == 'ubuntu-latest' }} @@ -55,28 +65,49 @@ jobs: sudo apt-get install libgtk-3-dev libasound2-dev - name: Build release binary (no debugging features) - run: cargo build --profile ci --verbose --no-default-features --features=${{ env.RELEASE_FEATURES }} --package dust-desktop + run: > + cargo build + --verbose + --profile ci + --target ${{ matrix.target }} + --no-default-features + --features=${{ env.RELEASE_FEATURES }} + --package dust-desktop - name: Upload release binary (no debugging features) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }} - path: target/ci/dust-desktop${{ matrix.artifact-extension }} + path: target/${{ matrix.target }}/ci/dust-desktop${{ matrix.artifact-extension }} - name: Build release binary (debugging features) - run: cargo build --profile ci --verbose --no-default-features --features=${{ env.DEBUG_FEATURES }} --package dust-desktop + run: > + cargo build + --verbose + --profile ci + --target ${{ matrix.target }} + --no-default-features + --features=${{ env.DEBUG_FEATURES }} + --package dust-desktop - name: Upload release binary (debugging features) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }}-debug - path: target/ci/dust-desktop${{ matrix.artifact-extension }} + path: target/${{ matrix.target }}/ci/dust-desktop${{ matrix.artifact-extension }} - name: Build release binary (debugging features + GDB) - run: cargo build --profile ci --verbose --no-default-features --features=${{ env.DEBUG_GDB_FEATURES }} --package dust-desktop + run: > + cargo build + --verbose + --profile ci + --target ${{ matrix.target }} + --no-default-features + --features=${{ env.DEBUG_GDB_FEATURES }} + --package dust-desktop - name: Upload release binary (debugging features + GDB) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact }}-debug-gdb - path: target/ci/dust-desktop${{ matrix.artifact-extension }} + path: target/${{ matrix.target }}/ci/dust-desktop${{ matrix.artifact-extension }} diff --git a/.github/workflows/deploy-web.yml b/.github/workflows/deploy-web.yml index 1008000..b5ecdfa 100644 --- a/.github/workflows/deploy-web.yml +++ b/.github/workflows/deploy-web.yml @@ -15,30 +15,33 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@v1 with: toolchain: nightly - override: true - components: rust-src - name: Setup Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: '17' - - name: Cache dependencies and build directory - uses: actions/cache@v2 + - name: Cache Cargo registry + uses: actions/cache@v3 with: path: | ~/.cargo/bin ~/.cargo/registry/index ~/.cargo/registry/cache ~/.cargo/git/db - target/ - key: web + key: cargo-registry + + - name: Cache build directory + uses: actions/cache@v3 + with: + path: target/ + key: web-release - name: Build working-directory: frontend/web diff --git a/.github/workflows/run-clippy-and-test.yml b/.github/workflows/run-clippy-and-test.yml index 06b4d73..8c688e3 100644 --- a/.github/workflows/run-clippy-and-test.yml +++ b/.github/workflows/run-clippy-and-test.yml @@ -7,7 +7,7 @@ on: env: CARGO_TERM_COLOR: always - FEATURES: xq-audio,discord-presence,debug-views,log,pu-checks,gdb-server,dldi + FEATURES: xq-audio,discord-presence,log,debug-views,pu-checks,gdb-server,dldi MACOSX_DEPLOYMENT_TARGET: 10.11 jobs: @@ -19,25 +19,23 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install nightly toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@v1 with: toolchain: nightly - override: true components: clippy - - name: Cache dependencies and build directory - uses: actions/cache@v2 + - name: Cache Cargo registry + uses: actions/cache@v3 with: path: | ~/.cargo/bin ~/.cargo/registry/index ~/.cargo/registry/cache ~/.cargo/git/db - target/ - key: ${{ matrix.os }}-clippy + key: cargo-registry - name: Install GTK and ALSA if: ${{ matrix.os == 'ubuntu-latest' }}