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 c67ddaa commit 87f624e
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 @@ -97,12 +97,12 @@ jobs:
- run: cargo no-dev-deps check --workspace --all-features -v
- run: cargo no-dev-deps build --workspace --all-features -v

# 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 @@ -117,6 +117,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 @@ -130,13 +132,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-no-dev-deps
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-no-dev-deps*
path: cargo-no-dev-deps-${{ 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 87f624e

Please sign in to comment.