Skip to content

Commit

Permalink
Emit build program name and version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmicHorrorDev committed Oct 22, 2023
1 parent 64649bb commit 20e5fdc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ jobs:
with:
targets: ${{ matrix.target }}

- name: Install Cross
- name: Setup native compilation
if: ${{ matrix.use-cross == false }}
shell: bash
echo "CARGO=cargo" >> $GITHUB_ENV

- name: Setup cross compilation
if: ${{ matrix.use-cross == true }}
shell: bash
run: |
Expand All @@ -77,12 +82,13 @@ jobs:
curl -LO "https://github.com/cross-rs/cross/releases/download/v0.2.5/cross-x86_64-unknown-linux-musl.tar.gz"
tar xf cross-x86_64-unknown-linux-musl.tar.gz
echo "CARGO=cross" >> $GITHUB_ENV
echo "RUSTFLAGS='--cfg sd_cross_compile'"
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "RUSTFLAGS='--cfg sd_cross_compile'" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Build
run: |
cargo build --release --locked
$CARGO --version
$CARGO build --release --locked --target ${{ matrix.target }}
- name: Upload binaries to release
uses: svenstaro/[email protected]
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ jobs:
with:
targets: ${{ matrix.target }}

- name: Setup native compilation
if: ${{ matrix.use-cross == false }}
shell: bash
echo "CARGO=cargo" >> $GITHUB_ENV

- name: Install Cross
if: ${{ matrix.use-cross == true }}
shell: bash
Expand All @@ -72,9 +77,9 @@ jobs:
tar xf cross-x86_64-unknown-linux-musl.tar.gz
echo "CARGO=cross" >> $GITHUB_ENV
echo "RUSTFLAGS='--cfg sd_cross_compile'"
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Test
run: |
cargo test
$CARGO --version
$CARGO test --target ${{ matrix.target }}

0 comments on commit 20e5fdc

Please sign in to comment.