From 486422bb16ea55b7472263598ff9b017e4ae0356 Mon Sep 17 00:00:00 2001 From: Kyle Julian <38759683+kylejulian98@users.noreply.github.com> Date: Sun, 6 Sep 2020 00:40:14 +0100 Subject: [PATCH] Fix release version number (#41) * Update release-build.yml * Add test to find jar file * Include task to get asset path and name * Fix issue with variable not storing command output * Updated to use environment variables for asset * Fix usage of environment variables * Updated echo commands to communicate with server * Refactored set-env to one liner * Fix workflow command for setting environment var * Remove quotes from set-env * Fixed usage of environment variable in asset upload --- .github/workflows/release-build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 8b52ee7..71f1b92 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -43,6 +43,13 @@ jobs: tag_name: ${{ github.ref }} release_name: Release ${{ github.ref }} draft: true + + - name: Find Asset Details + run: | + assetPath=$(find ${{ github.workspace }}/build/libs -name TWSManagement\*) + assetName=$(basename -a $assetPath) + echo ::set-env name=ASSET_PATH::$assetPath + echo ::set-env name=ASSET_NAME::$assetName - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -50,6 +57,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ github.workspace }}/build/libs/TWSManagement-${GITHUB_REF/refs\/tags\//}.jar - asset_name: TWSManagement.jar + asset_path: ${{ env.ASSET_PATH }} + asset_name: ${{ env.ASSET_NAME }} asset_content_type: application/java-archive