From 65008ca47ee5e6b86173a7213c812e57839c9cc3 Mon Sep 17 00:00:00 2001 From: Mahor Foruzesh Date: Tue, 9 Jul 2024 09:34:32 +0000 Subject: [PATCH] build: fix release.yaml --- .github/workflows/ci.yaml | 4 ++-- .github/workflows/release.yaml | 26 ++++++++++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b3512de..3fd8a2f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -98,8 +98,8 @@ jobs: - { os: ubuntu-latest, target: aarch64-unknown-linux-musl, cmd: cross } - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, cmd: cargo } - { os: ubuntu-latest, target: x86_64-unknown-linux-musl, cmd: cargo } - # - { os: windows-latest, target: aarch64-pc-windows-msvc } - # - { os: windows-latest, target: x86_64-pc-windows-msvc } + # - { os: windows-latest, target: aarch64-pc-windows-msvc, cmd: cross } + # - { os: windows-latest, target: x86_64-pc-windows-msvc, cmd: cargo } runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8333a7d..1b3e173 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -71,12 +71,12 @@ jobs: fail-fast: false matrix: include: - - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu } - - { os: ubuntu-latest, target: aarch64-unknown-linux-musl } - - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu } - - { os: ubuntu-latest, target: x86_64-unknown-linux-musl } - - { os: windows-latest, target: aarch64-pc-windows-msvc } - - { os: windows-latest, target: x86_64-pc-windows-msvc } + - { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, cmd: cross } + - { os: ubuntu-latest, target: aarch64-unknown-linux-musl, cmd: cross } + - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, cmd: cargo } + - { os: ubuntu-latest, target: x86_64-unknown-linux-musl, cmd: cargo } + - { os: windows-latest, target: aarch64-pc-windows-msvc, cmd: cross } + - { os: windows-latest, target: x86_64-pc-windows-msvc, cmd: cargo } # - { os: macos-latest, target: aarch64-apple-darwin } # - { os: macos-latest, target: x86_64-apple-darwin } # - { os: macos-latest, target: universal-apple-darwin } @@ -87,10 +87,14 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.target }} - - if: matrix.os != 'windows-latest' + - if: matrix.cmd == 'cross' + uses: taiki-e/install-action@v2 + with: + tool: cross + - if: matrix.target == 'x86_64-unknown-linux-gnu' uses: taiki-e/install-action@v2 with: - tool: cargo-deb,cross + tool: cargo-deb - name: Install prerequisites shell: bash @@ -122,12 +126,10 @@ jobs: esac - name: Build debian package - if: | - matrix.target == 'aarch64-unknown-linux-gnu' || - matrix.target == 'x86_64-unknown-linux-gnu' + if: matrix.target == 'x86_64-unknown-linux-gnu' id: deb run: | - cross build --release --target ${{ matrix.target }} --all + ${{ matrix.cmd }} build --release --target ${{ matrix.target }} --all cargo deb --no-build --target ${{ matrix.target }} dir="target/${{ matrix.target }}/debian" arch="$(a=${{ matrix.target }} && echo "${a%%-*}")"