diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 4bdf2a8ac36..c0589a53daf 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -653,12 +653,18 @@ jobs: *) echo "::error::-Cprofile-use missing from RUSTFLAGS" ; exit 1 ;; esac test -s "$(cat target/coreutils-pgo/profdata-path.txt)" + - name: Set release profile + if: github.event_name != 'pull_request' + run: echo PROFILE=release >> "${GITHUB_ENV}" && echo PROFILE_ARG=--release >> "${GITHUB_ENV}" + - name: Set debug profile + if: github.event_name == 'pull_request' + run: echo PROFILE=debug >> "${GITHUB_ENV}" - name: Build coreutils shell: bash if: matrix.job.skip-publish != true && matrix.job.check-only != true && matrix.job.target != 'x86_64-pc-windows-msvc' run: | ## Build - ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release --config=profile.release.strip=true \ + ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build ${PROFILE_ARG} --config=profile.${PROFILE}.strip=true \ --target=${{ matrix.job.target }} ${{ steps.vars.outputs.CARGO_FEATURES_OPTION }} ${{ steps.vars.outputs.CARGO_DEFAULT_FEATURES_OPTION }} # We don't want to have many duplicated long jobs at here # So we build individual binaries (including coreutils) for few platforms until we deduplicate many release build for Linux @@ -666,7 +672,7 @@ jobs: if: matrix.job.skip-tests != true && matrix.job.target == 'x86_64-pc-windows-msvc' shell: bash run: | - ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build --release --config=profile.release.strip=true \ + ${{ steps.vars.outputs.CARGO_CMD }} ${{ steps.vars.outputs.CARGO_CMD_OPTIONS }} build ${PROFILE_ARG} --config=profile.${PROFILE}.strip=true \ --target=${{ matrix.job.target }} \ ${{ steps.dep_vars.outputs.CARGO_UTILITY_LIST_OPTIONS }} \ -p coreutils --features=${{ matrix.job.features }} @@ -675,7 +681,7 @@ jobs: shell: bash run: | ## Package artifact(s) - find target/${{ matrix.job.target }}/release -maxdepth 1 -type f \ + find target/${{ matrix.job.target }}/${PROFILE} -maxdepth 1 -type f \ \( -name "*.wasm" -o -name "*.exe" -o -perm -u+x \) \ -exec ln -v {} "${{ steps.vars.outputs.STAGING }}/${{ steps.vars.outputs.PKG_BASENAME }}/" \; # README and LICENSE @@ -693,8 +699,8 @@ jobs: if: matrix.job.target == 'x86_64-unknown-linux-gnu' && matrix.job.features == 'feat_os_unix,uudoc' run: | mkdir -p share/{man/man1,bash-completion/completions,fish/vendor_completions.d,zsh/site-functions,elvish/lib} - _uudoc=target/${{ matrix.job.target }}/release/uudoc - for bin in $('target/${{ matrix.job.target }}/release/coreutils' --list) coreutils;do + _uudoc=target/${{ matrix.job.target }}/${PROFILE}/uudoc + for bin in $('target/${{ matrix.job.target }}/${PROFILE}/coreutils' --list) coreutils;do ${_uudoc} manpage ${bin} > share/man/man1/${bin}.1 ${_uudoc} completion ${bin} bash > share/bash-completion/completions/${bin}.bash ${_uudoc} completion ${bin} fish > share/fish/vendor_completions.d/${bin}.fish