Skip to content

Commit

Permalink
ci: Use upload-rust-binary-action (dry-run mode) in build job
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Oct 9, 2023
1 parent 7b8fd39 commit c0aa8ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ jobs:
cargo hack check --feature-powerset --workspace
cargo uninstall cargo-hack
# NB: sync with upload-assets job in release.yml.
build:
name: build (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
# When updating this list, the reminder to update the target list in release.yml.
include:
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
Expand All @@ -147,6 +147,8 @@ jobs:
- target: x86_64-pc-windows-msvc
os: windows-2019
- target: x86_64-unknown-freebsd
- target: universal-apple-darwin
os: macos-11
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
timeout-minutes: 60
steps:
Expand All @@ -160,13 +162,20 @@ jobs:
target: ${{ matrix.target }}
- run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >>"${GITHUB_ENV}"
if: endsWith(matrix.target, 'windows-msvc')
- run: cargo build --target ${{ matrix.target }}
- run: cargo build --target ${{ matrix.target }} --release
- uses: taiki-e/upload-rust-binary-action@v1
with:
dry-run: true
bin: cargo-hack
target: ${{ matrix.target }}
tar: all
zip: windows
ref: refs/tags/dummy
token: dummy
# For debugging
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/cargo-hack*
path: cargo-hack-${{ matrix.target }}.*

miri:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

# NB: sync with build job in ci.yml.
upload-assets:
name: ${{ matrix.target }}
if: github.repository_owner == 'taiki-e'
needs:
- create-release
strategy:
matrix:
# When updating this list, the reminder to update the target list in ci.yml.
include:
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
Expand Down

0 comments on commit c0aa8ce

Please sign in to comment.