From 42d12f3f36337b081a25dc762e86c06b0aff8c04 Mon Sep 17 00:00:00 2001 From: Sven Kanoldt Date: Thu, 31 Oct 2024 11:31:18 +0100 Subject: [PATCH] fix(ci): fix the cross build issue (#34) --- .github/workflows/build.yml | 1 - .github/workflows/rebase.yml | 1 - .github/workflows/release-binary-assets.yml | 12 ++++++++++++ .github/workflows/release.yml | 2 -- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fd12cc..c7a86cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,7 +55,6 @@ jobs: rust: ["nightly", "stable"] runs-on: ${{ matrix.version }} continue-on-error: ${{ matrix.rust == 'nightly' }} - environment: build steps: - uses: actions/checkout@v4 - name: setup | rust diff --git a/.github/workflows/rebase.yml b/.github/workflows/rebase.yml index b1c97b6..fc57f3c 100644 --- a/.github/workflows/rebase.yml +++ b/.github/workflows/rebase.yml @@ -4,7 +4,6 @@ on: types: [created] jobs: rebase: - environment: rebase name: Rebase if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') runs-on: ubuntu-latest diff --git a/.github/workflows/release-binary-assets.yml b/.github/workflows/release-binary-assets.yml index 81c0d43..54198dd 100644 --- a/.github/workflows/release-binary-assets.yml +++ b/.github/workflows/release-binary-assets.yml @@ -40,15 +40,27 @@ jobs: targets: ${{ matrix.target }} - uses: Swatinem/rust-cache@v2 - uses: taiki-e/install-action@v2 + if: ${{ matrix.cross == true }} with: tool: cross - name: build with cross + if: ${{ matrix.cross == true }} shell: bash run: cross build --locked --release --target ${{ matrix.target }} - name: smoke test + if: ${{ matrix.cross == true }} shell: bash run: | cross run --locked --release --target ${{ matrix.target }} -- --help + - name: build with cargo + if: ${{ matrix.cross != true }} + shell: bash + run: cargo build --locked --release --target ${{ matrix.target }} + - name: smoke test with cargo + if: ${{ matrix.cross != true }} + shell: bash + run: | + cargo run --locked --release --target ${{ matrix.target }} -- --help - name: Create Archive id: archive shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9cbaa22..5e89f83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,6 @@ jobs: name: post / cargo publish needs: doing-a-build runs-on: ubuntu-latest - environment: release steps: - uses: actions/checkout@v4 - name: setup | rust @@ -37,7 +36,6 @@ jobs: name: post / github release needs: publish runs-on: ubuntu-latest - environment: release steps: - uses: actions/checkout@v4 - name: setup | rust