diff --git a/.github/workflows/publish-cli-rs.yml b/.github/workflows/publish-cli-rs.yml index d4f17f883..3a17c872e 100644 --- a/.github/workflows/publish-cli-rs.yml +++ b/.github/workflows/publish-cli-rs.yml @@ -8,40 +8,45 @@ on: jobs: build: - runs-on: ${{ matrix.target.platform }} + runs-on: ${{ matrix.config.os }} strategy: fail-fast: false matrix: - target: - - { - name: 'x86_64-unknown-linux-gnu', - platform: 'ubuntu-18.04', - ext: '' - } - - { name: 'x86_64-apple-darwin', platform: 'macos-latest', ext: '' } - - { - name: 'x86_64-pc-windows-msvc', - platform: 'windows-latest', - ext: '.exe' - } + config: + - os: ubuntu-18.04 + rust_target: x86_64-unknown-linux-gnu + ext: '' + - os: macos-latest + rust_target: x86_64-apple-darwin + ext: '' + - os: macos-latest + rust_target: aarch64-apple-darwin + ext: '' + - os: windows-latest + rust_target: x86_64-pc-windows-msvc + ext: '.exe' steps: - name: Checkout uses: actions/checkout@v3 - - name: install stable - uses: actions-rs/toolchain@v1 + - name: 'Setup Rust' + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable + targets: ${{ matrix.config.rust_target }} + + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.config.rust_target }} - name: install Linux dependencies - if: matrix.target.platform == 'ubuntu-latest' + if: matrix.config.os == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev - - name: build CLI + - name: Build CLI uses: actions-rs/cargo@v1 with: command: build @@ -50,8 +55,8 @@ jobs: - name: Upload CLI uses: actions/upload-artifact@v3 with: - name: cargo-tauri-${{ matrix.target.name }}${{ matrix.target.ext }} - path: tooling/cli/target/release/cargo-tauri${{ matrix.target.ext }} + name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }} + path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }} if-no-files-found: error upload: