diff --git a/.github/actions/rust/action.yml b/.github/actions/rust/action.yml index 2e0ed7f7..8c80baa0 100644 --- a/.github/actions/rust/action.yml +++ b/.github/actions/rust/action.yml @@ -7,15 +7,30 @@ inputs: components: required: false type: string + targets: + required: false + type: string + dependencies: + description: 'one of: linux, windows, none' + required: false + type: string + default: 'linux' runs: using: 'composite' steps: - - shell: bash + - if: ${{ inputs.dependencies == 'linux' }} + shell: bash run: | sudo apt-get update sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev + - if: ${{ inputs.dependencies == 'windows' }} + shell: bash + run: | + sudo apt-get update + sudo apt-get install --no-install-recommends -y mingw-w64 + - shell: bash run: "git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id" @@ -31,6 +46,7 @@ runs: id: rust-toolchain with: components: ${{ inputs.components }} + targets: ${{ inputs.targets }} - shell: bash run: rustc --version && cargo --version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fdccfc1..da38b508 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,57 +14,26 @@ jobs: include: - os: ubuntu-latest target: 'x86_64-unknown-linux-gnu' + dependencies: linux - os: ubuntu-latest target: 'x86_64-pc-windows-gnu' + dependencies: windows - os: macos-latest target: 'x86_64-apple-darwin' + dependencies: none - os: macos-latest target: 'aarch64-apple-darwin' + dependencies: none steps: - uses: actions/checkout@v3 - - name: Create LFS File List - run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id - - name: Restore LFS Cache - uses: actions/cache@v3 - id: lfs-cache - with: - path: .git/lfs - key: nightly-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 - - name: Git LFS Pull - run: git lfs pull - - - uses: dtolnay/rust-toolchain@stable - id: rust-toolchain + - uses: ./.github/actions/rust + name: Setup with: + name: prd-build targets: ${{ matrix.target }} - - - name: Rust Cache - uses: actions/cache@v3 - id: rust-cache - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: nightly-${{ steps.rust-toolchain.outputs.cachekey }}-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} - - - name: Install x86_64-unknown-linux-gnu - if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends -y libasound2-dev libudev-dev - - - name: Install x86_64-pc-windows-gnu - if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }} - run: | - sudo apt-get update - sudo apt-get install --no-install-recommends -y mingw-w64 - - - run: rustc --version && cargo --version + dependencies: ${{ matrix.dependencies }} - name: Install cargo-auditable run: cargo install --force cargo-auditable