From 67ecf5bd794d274fd6b9abb187e52ed5df0c5c89 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 24 Nov 2019 14:28:57 -0600 Subject: [PATCH] maint/cicd ~ add 'strip' to GHA packaging step --- .github/workflows/CICD.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CICD.yml b/.github/workflows/CICD.yml index 292b624..816af61 100644 --- a/.github/workflows/CICD.yml +++ b/.github/workflows/CICD.yml @@ -74,6 +74,10 @@ jobs: # * test only binary for arm-type targets unset CARGO_TEST_OPTIONS; case ${{ matrix.target }} in arm-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}";; esac; echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS} + # * strip final executable? + STRIP="strip"; case ${{ matrix.target }} in arm-*) STRIP="";; *-pc-windows-*) STRIP="";; esac; + echo set-output name=STRIP::${STRIP} + echo ::set-output name=STRIP::${STRIP} - name: Create all needed build/work directories shell: bash run: mkdir -p 'package' @@ -103,7 +107,9 @@ jobs: path: target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ env.EXE_suffix }} - name: Package shell: bash - run: cp 'target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' 'package/${{ steps.vars.outputs.PKG_NAME }}' + run: | + cp 'target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' 'package/${{ steps.vars.outputs.PKG_NAME }}' + if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" 'package/${{ steps.vars.outputs.PKG_NAME }}'; fi - name: Publish uses: softprops/action-gh-release@v1 if: steps.vars.outputs.DEPLOY @@ -148,6 +154,10 @@ jobs: # * test only binary for arm-type targets unset CARGO_TEST_OPTIONS; case ${{ matrix.target }} in arm-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}";; esac; echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS} + # * strip final executable? + STRIP="strip"; case ${{ matrix.target }} in arm-*) STRIP="";; *-pc-windows-*) STRIP="";; esac; + echo set-output name=STRIP::${STRIP} + echo ::set-output name=STRIP::${STRIP} - name: Create all needed build/work directories shell: bash run: mkdir -p 'package' @@ -177,7 +187,9 @@ jobs: path: target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ env.EXE_suffix }} - name: Package shell: bash - run: cp 'target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' 'package/${{ steps.vars.outputs.PKG_NAME }}' + run: | + cp 'target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' 'package/${{ steps.vars.outputs.PKG_NAME }}' + if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" 'package/${{ steps.vars.outputs.PKG_NAME }}'; fi - name: Publish uses: softprops/action-gh-release@v1 if: steps.vars.outputs.DEPLOY @@ -224,6 +236,10 @@ jobs: # * test only binary for arm-type targets unset CARGO_TEST_OPTIONS; case ${{ matrix.target }} in arm-*) CARGO_TEST_OPTIONS="--bin ${PROJECT_NAME}";; esac; echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS} + # * strip final executable? + STRIP="strip"; case ${{ matrix.target }} in arm-*) STRIP="";; *-pc-windows-*) STRIP="";; esac; + echo set-output name=STRIP::${STRIP} + echo ::set-output name=STRIP::${STRIP} - name: Create all needed build/work directories shell: bash run: mkdir -p 'package' @@ -253,7 +269,9 @@ jobs: path: target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ env.EXE_suffix }} - name: Package shell: bash - run: cp 'target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' 'package/${{ steps.vars.outputs.PKG_NAME }}' + run: | + cp 'target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }}${{ steps.vars.outputs.EXE_suffix }}' 'package/${{ steps.vars.outputs.PKG_NAME }}' + if [ -n "${{ steps.vars.outputs.STRIP }}" ]; then "${{ steps.vars.outputs.STRIP }}" 'package/${{ steps.vars.outputs.PKG_NAME }}'; fi - name: Publish uses: softprops/action-gh-release@v1 if: steps.vars.outputs.DEPLOY