change build bin path #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Self-test | |
on: | |
push: | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
permissions: | |
contents: write | |
jobs: | |
build-and-upload: | |
name: Build and upload | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- platform_name: FreeBSD-x86_64 | |
os: ubuntu-20.04 | |
target: x86_64-unknown-freebsd | |
expect_file_re: "x86-64.+FreeBSD" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-x86_64 | |
os: ubuntu-20.04 | |
target: x86_64-unknown-linux-musl | |
expect_file_re: "ELF.+x86-64" | |
expect_cross: "--no-expect-cross" | |
expect_stripped: "--expect-stripped" | |
can_test: true | |
- platform_name: Linux-aarch64 | |
os: ubuntu-20.04 | |
target: aarch64-unknown-linux-musl | |
expect_file_re: "aarch64" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: true | |
- platform_name: Linux-aarch64-with-cross-v0.2.3 | |
os: ubuntu-20.04 | |
target: aarch64-unknown-linux-musl | |
cross-version: "v0.2.3" | |
expect_file_re: "aarch64" | |
expect_cross: "--expect-cross" | |
expect_cross_version: "0.2.3" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-arm | |
os: ubuntu-20.04 | |
target: arm-unknown-linux-musleabi | |
expect_file_re: "32.+ARM" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: true | |
- platform_name: Linux-i586 | |
os: ubuntu-20.04 | |
target: i586-unknown-linux-musl | |
expect_file_re: "ELF.+80386" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-i686 | |
os: ubuntu-20.04 | |
target: i686-unknown-linux-musl | |
expect_file_re: "ELF.+80386" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-mips | |
os: ubuntu-20.04 | |
target: mips-unknown-linux-musl | |
expect_file_re: "MIPS32.+mips-" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-mipsel | |
os: ubuntu-20.04 | |
target: mipsel-unknown-linux-musl | |
expect_file_re: "MIPS32.+mipsel-" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-mips64 | |
os: ubuntu-20.04 | |
target: mips64-unknown-linux-muslabi64 | |
expect_file_re: "MIPS64" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-mips64el | |
os: ubuntu-20.04 | |
target: mips64el-unknown-linux-muslabi64 | |
expect_file_re: "MIPS64" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-powerpc | |
os: ubuntu-20.04 | |
target: powerpc-unknown-linux-gnu | |
expect_file_re: "32.+PowerPC" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-powerpc64 | |
os: ubuntu-20.04 | |
target: powerpc64-unknown-linux-gnu | |
expect_file_re: "64.+PowerPC" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-powerpc64le | |
os: ubuntu-20.04 | |
target: powerpc64le-unknown-linux-gnu | |
expect_file_re: "64.+PowerPC" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-riscv64 | |
os: ubuntu-20.04 | |
target: riscv64gc-unknown-linux-gnu | |
expect_file_re: "64.+RISC-V" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Linux-s390x | |
os: ubuntu-20.04 | |
target: s390x-unknown-linux-gnu | |
expect_file_re: "64.+S/390" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: NetBSD-x86_64 | |
os: ubuntu-20.04 | |
target: x86_64-unknown-netbsd | |
expect_file_re: "x86-64.+NetBSD" | |
expect_cross: "--expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Windows-aarch64 | |
os: windows-latest | |
target: aarch64-pc-windows-msvc | |
expect_file_re: "Aarch64.+Windows" | |
expect_cross: "--no-expect-cross" | |
expect_stripped: "--no-expect-stripped" | |
can_test: false | |
- platform_name: Windows-i686 | |
os: windows-latest | |
target: i686-pc-windows-msvc | |
expect_file_re: "80386.+Windows" | |
expect_cross: "--no-expect-cross" | |
expect_stripped: "--expect-stripped" | |
can_test: false | |
- platform_name: Windows-x86_64 | |
os: windows-latest | |
target: x86_64-pc-windows-msvc | |
expect_file_re: "x86-64.+Windows" | |
expect_stripped: "--expect-stripped" | |
can_test: false | |
- platform_name: macOS-x86_64 | |
os: macOS-latest | |
target: x86_64-apple-darwin | |
expect_file_re: "Mach-O.+x86_64" | |
expect_cross: "--no-expect-cross" | |
expect_stripped: "--expect-stripped" | |
can_test: false | |
- platform_name: macOS-aarch64 | |
os: macOS-latest | |
target: aarch64-apple-darwin | |
expect_file_re: "Mach-O.+arm64" | |
expect_cross: "--no-expect-cross" | |
expect_stripped: "--expect-stripped" | |
can_test: false | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
repository: ${{github.repository}} | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.platform.target }} | |
- name: Get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --verbose --release --target ${{ matrix.platform.target }} | |
- name: list result files (debug) | |
shell: bash | |
run: | | |
find target | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" | |
- name: Build archive | |
shell: bash | |
run: | | |
binary_name="robotagent" | |
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.platform.target }}" | |
mkdir "$dirname" | |
if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then | |
mv "target/release/${{ matrix.platform.target }}/release/$binary_name.exe" "$dirname" | |
else | |
mv "target/release/${{ matrix.platform.target }}/release/$binary_name" "$dirname" | |
fi | |
if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then | |
7z a "$dirname.zip" "$dirname" | |
echo "ASSET=$dirname.zip" >> $GITHUB_ENV | |
else | |
tar -czf "$dirname.tar.gz" "$dirname" | |
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
- name: Upload the binaries | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
${{ env.ASSET }} | |