diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index 55987feb8..30deef9ba 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -67,7 +67,7 @@ jobs: commit-suffix: win-x86 nuget-rid: win-x86 target: i686-pc-windows-msvc - cross: 'true' + - name: ARM64-windows suffix: win-arm64 @@ -85,7 +85,7 @@ jobs: os: ubuntu-24.04 target-cpu: x86-64 target: x86_64-unknown-linux-musl - target-feature: +crt-static + target-feature: -crt-static features: mimalloc cross: 'true' @@ -96,7 +96,7 @@ jobs: nuget-rid: linux-musl-arm64 os: ubuntu-24-arm-32gb target-cpu: generic - target-feature: +crt-static + target-feature: -crt-static target: aarch64-unknown-linux-musl features: mimalloc cross: 'true' @@ -151,9 +151,10 @@ jobs: shell: bash run: | echo "TARGET_DIR=target/${{ matrix.target }}/" >> $GITHUB_ENV - echo "REL_BINARIES_DIR=target/${{ matrix.target }}/release/" >> $GITHUB_ENV echo "TAG_SHA_SUFFIX=${{ github.ref_name }}-${{ env.GITHUB_SHA_SHORT }}-${{ matrix.suffix }}" >> $GITHUB_ENV echo "RUSTFLAGS=${{ matrix.target-cpu && format('-C target-cpu={0}',matrix.target-cpu) }} ${{ matrix.target-feature && format('-C target-feature={0}',matrix.target-feature) }}" >> $GITHUB_ENV + echo "PROFILE=release" >> $GITHUB_ENV + echo "REL_BINARIES_DIR=target/${{ matrix.target }}/release/" >> $GITHUB_ENV - name: Set env vars IMAGEFLOW_TOOL_PATH, ESTIMATED_ARTIFACT_URL shell: bash @@ -162,7 +163,8 @@ jobs: echo "IMAGEFLOW_TOOL_PATH=${{ env.REL_BINARIES_DIR }}imageflow_tool${{ contains(matrix.os, 'windows') && '.exe' || '' }}" >> $GITHUB_ENV echo "ESTIMATED_ARTIFACT_URL=${{ env.HTTPS_IMAGEFLOW_NIGHTLIES }}/${{ env.IMAGEFLOW_TAG_SHA_SUFFIX }}.${{ env.EXTENSION }}" >> $GITHUB_ENV echo "RELATIVE_ARTIFACT_ARCHIVE=./artifacts/github/${{ env.IMAGEFLOW_TAG_SHA_SUFFIX }}.${{ env.EXTENSION }}" >> $GITHUB_ENV - echo "CARGO_TARGET_FEATURES_ARGS=${{ matrix.target && format('--target={0}',matrix.target) }} ${{ matrix.features && format('--features={0}',matrix.features) }}" >> $GITHUB_ENV + echo "CARGO_PROFILE_TARGET_FEATURES_ARGS=--${{ env.PROFILE }} ${{ matrix.target && format('--target={0}',matrix.target) }} ${{ matrix.features && format('--features={0}',matrix.features) }}" >> $GITHUB_ENV + echo "CROSS_ARGS=--locked --${{ env.PROFILE }} ${{ matrix.features && format('--features={0}',matrix.features) }}" >> $GITHUB_ENV echo "RUSTFLAGS=${{ matrix.target-cpu && format('-C target-cpu={0}',matrix.target-cpu) }}" >> $GITHUB_ENV echo "FETCH_COMMIT_SUFFIX=${{ matrix.commit-suffix }}" >> $GITHUB_ENV echo "CI_TAG=${{ github.ref_name }}" >> $GITHUB_ENV @@ -175,24 +177,28 @@ jobs: echo "CI_BUILD_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV echo "ESTIMATED_DOCS_URL=${{ env.HTTPS_IMAGEFLOW_NIGHTLIES }}/doc" >> $GITHUB_ENV echo "DEBUG=False" >> $GITHUB_ENV - echo "PROFILE=release" >> $GITHUB_ENV echo "TARGET_CPU=${{ matrix.target-cpu }}" >> $GITHUB_ENV - - name: Build Release - if: matrix.cross != 'true' - run: cargo build --all --release ${{ env.CARGO_TARGET_FEATURES_ARGS }} + + - name: "Build ${{ env.PROFILE }}" + if: matrix.cross != 'true' && matrix.woa != 'true' + run: cargo build --all ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }} shell: bash #env: # OPT_LEVEL: 0 - - name: Cross Build Release + - name: "Build ${{ env.PROFILE }}" + if: matrix.woa == 'true' + run: "& Launch-VsDevShell.ps1 | cargo build --all ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }}" + shell: powershell + + - name: "Build ${{ env.PROFILE }} (Cross)" uses: houseabsolute/actions-rust-cross@v1.0.1 with: command: "build" target: ${{ matrix.target }} toolchain: stable - args: - "--locked --release ${{ matrix.features && format('--features={0}',matrix.features) }}" + args: "${{ env.CROSS_ARGS }}" if: matrix.cross == 'true' @@ -200,35 +206,34 @@ jobs: run: "${{ env.IMAGEFLOW_TOOL_PATH }} diagnose --show-compilation-info" shell: bash - - name: Test - run: cargo test --all --locked --release ${{ env.CARGO_TARGET_FEATURES_ARGS }} + - name: "Test ${{ env.PROFILE }}" + run: cargo test --all --locked ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }} shell: bash - env: - RUSTFLAGS: "${{ env.RUSTFLAGS }}" if: matrix.cross != 'true' - - name: Cross Test + - name: "Test ${{ env.PROFILE }} (WOA)" + run: "& Launch-VsDevShell.ps1 | cargo test --all ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }}" + shell: powershell + if: matrix.woa == 'true' + + - name: "Test ${{ env.PROFILE }} (Cross)" uses: houseabsolute/actions-rust-cross@v1.0.1 with: command: "test" target: ${{ matrix.target }} toolchain: stable - args: - "--locked --release ${{ matrix.features && format('--features={0}',matrix.features) }}" + args: "${{ env.CROSS_ARGS }}" if: matrix.cross == 'true' - - name: Build Docs - run: cargo doc --all --release --no-deps ${{ env.CARGO_TARGET_FEATURES_ARGS }} + - name: "Build ${{ env.PROFILE }} Docs" + run: cargo doc --all --no-deps ${{ env.CARGO_PROFILE_TARGET_FEATURES_ARGS }} if: matrix.cross != 'true' - - name: Cross Build Docs - uses: houseabsolute/actions-rust-cross@v1.0.1 - with: - command: "doc" - target: ${{ matrix.target }} - toolchain: stable - args: - "--all --release --no-deps ${{ env.CARGO_TARGET_FEATURES_ARGS }}" + # actions-rust-cross does not support cargo doc + - name: "mkdir -p ./${{ env.TARGET_DIR }}doc" + run: | + mkdir -p ./${{ env.TARGET_DIR }}doc + touch ./${{ env.TARGET_DIR }}doc/not-available.txt if: matrix.cross == 'true' - name: Create .zip / .tar.gz files for upload to Github Release & S3 @@ -239,7 +244,7 @@ jobs: cd ./${TARGET_DIR}doc tar czf "../docs.${{ env.EXTENSION }}" ./* ) - mv ./${TARGET_DIR}docs.${{ env.EXTENSION }} ./artifacts/staging/ + mv ./${{ env.TARGET_DIR }}docs.${{ env.EXTENSION }} ./artifacts/staging/ cp -R ./${REL_BINARIES_DIR}/{imageflow_,libimageflow}* ./artifacts/staging/ cp bindings/headers/*.h ./artifacts/staging/headers/ @@ -259,7 +264,7 @@ jobs: cp "${TEMP_ARCHIVE_NAME}" "./artifacts/upload/releases/${{ github.ref_name }}/${{ env.IMAGEFLOW_TAG_SHA_SUFFIX }}.${{ env.EXTENSION }}" cp "${TEMP_ARCHIVE_NAME}" "./artifacts/upload/commits/${{ github.sha }}/${{ matrix.commit-suffix }}.${{ env.EXTENSION }}" env: - TEMP_ARCHIVE_NAME: "./artifacts/staging/archive${{ env.EXTENSION }}" + TEMP_ARCHIVE_NAME: "./artifacts/staging/archive.${{ env.EXTENSION }}" - name: Upload archive to Github Release