From ff326d66b58d192db0b3b89edda70a1365ee317c Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Thu, 18 Nov 2021 21:58:57 +0200 Subject: [PATCH] Modifications to build process according to PR #400 --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e050d1..5e1002b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,7 +125,7 @@ jobs: working-directory: build/Release run: | ep_setup_patch.exe - exit 0 + exit /b 0 - name: Upload artifacts uses: actions/upload-artifact@v2 @@ -154,26 +154,50 @@ jobs: echo "::set-output name=data::$MY_STRING" id: release_description - - name: Create/update release + - name: Create/update release (valinet) uses: actions/create-release@v1 - if: github.ref == 'refs/heads/master' && github.event.inputs.ref == '' + if: github.repository_owner == 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' id: create_release with: draft: false - prerelease: false + prerelease: ${{ !startsWith(github.event.head_commit.message, 'rel_') }} release_name: ${{ steps.release_name.outputs.data }} tag_name: ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }} body: ${{ steps.release_description.outputs.data }} env: GITHUB_TOKEN: ${{ secrets.PAT }} - - name: Upload setup + - name: Upload setup (valinet) uses: actions/upload-release-asset@v1 - if: github.ref == 'refs/heads/master' && github.event.inputs.ref == '' - env: - GITHUB_TOKEN: ${{ secrets.PAT }} + if: github.repository_owner == 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: ./build/Release/ep_setup.exe asset_name: ep_setup.exe asset_content_type: application/x-msdownload + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + + - name: Create/update release (forks) + uses: actions/create-release@v1 + if: github.repository_owner != 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' + id: create_release_fork + with: + draft: false + prerelease: ${{ !startsWith(github.event.head_commit.message, 'rel_') }} + release_name: ${{ steps.release_name.outputs.data }} + tag_name: ${{ steps.release_name.outputs.data }}_${{ steps.vars.outputs.sha_short }} + body: ${{ steps.release_description.outputs.data }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload setup (forks) + uses: actions/upload-release-asset@v1 + if: github.repository_owner != 'valinet' && github.ref == 'refs/heads/master' && github.event.inputs.ref == '' + with: + upload_url: ${{ steps.create_release_fork.outputs.upload_url }} + asset_path: ./build/Release/ep_setup.exe + asset_name: ep_setup.exe + asset_content_type: application/x-msdownload + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}