From 687716cb1ae904469fa5a4c7ca7ef549fc75e569 Mon Sep 17 00:00:00 2001 From: takeshix Date: Mon, 19 Apr 2021 14:15:53 +0200 Subject: [PATCH] Updated socat workflow --- .github/workflows/build-socat.yml | 10 +++++----- build/targets/build_socat.sh | 12 +++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-socat.yml b/.github/workflows/build-socat.yml index c54f758..b8d7447 100644 --- a/.github/workflows/build-socat.yml +++ b/.github/workflows/build-socat.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest container: muslcc/x86_64:i686-linux-musl outputs: - version: ${{ steps.build_socat.outputs.PACKAGED_NAME }} + version: ${{ steps.build_socat.outputs.PACKAGED_VERSION }} steps: - name: Checkout uses: actions/checkout@v2 @@ -137,13 +137,13 @@ jobs: - name: Tag Release run: | - git tag "${{ needs.build-x86.outputs.version }}" - git push origin "${{ needs.build-x86.outputs.version }}" + git tag "socat-v${{ needs.build-x86.outputs.version }}" + git push origin "socat-v${{ needs.build-x86.outputs.version }}" - name: Create Release uses: ncipollo/release-action@v1 with: - name: ${{ needs.build-x86.outputs.version }} - tag: ${{ needs.build-x86.outputs.version }} + name: socat-v{{ needs.build-x86.outputs.version }} + tag: socat-v${{ needs.build-x86.outputs.version }} artifacts: "/tmp/releases/*/*" token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/build/targets/build_socat.sh b/build/targets/build_socat.sh index f74fbd6..51b1f72 100755 --- a/build/targets/build_socat.sh +++ b/build/targets/build_socat.sh @@ -1,12 +1,16 @@ #!/bin/bash -set -e -set -x -set -o pipefail +if [ -z "$GITHUB_WORKSPACE" ];then + echo "GITHUB_WORKSPACE environemnt variable not set!" + exit 1 +fi if [ "$#" -ne 1 ];then echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" echo "Example: ${0} x86_64" exit 1 fi +set -e +set -o pipefail +set -x source $GITHUB_WORKSPACE/build/lib.sh init_lib "$1" @@ -33,11 +37,13 @@ main() { build_socat local version version=$(get_version "${BUILD_DIRECTORY}/socat/socat -V | grep 'socat version' | awk '{print \$3}'") + version_number=$(echo "$version" | cut -d"-" -f2) cp "${BUILD_DIRECTORY}/socat/socat" "${OUTPUT_DIRECTORY}/socat${version}" echo "[+] Finished building socat ${CURRENT_ARCH}" echo ::set-output name=PACKAGED_NAME::"socat${version}" echo ::set-output name=PACKAGED_NAME_PATH::"${OUTPUT_DIRECTORY}/*" + echo ::set-output name=PACKAGED_VERSION::"${version_number}" } main