From 2085e14f24c1f5021d0d49475248d90d88d23176 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 13 May 2020 10:39:56 -0600 Subject: [PATCH 1/6] updates workflow to only create releases for rc builds --- .github/workflows/docker.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 839ae827..8a46caf3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,7 +11,7 @@ on: env: # solution path doesn't need slashes unless there it is multiple folders deep - # solution name does not include extension. .sln is assumed + # solution name does not include extension. .sln is assumed SOLUTION_PATH: PepperDashEssentials SOLUTION_FILE: PepperDashEssentials # Do not edit this, we're just creating it here @@ -77,8 +77,14 @@ jobs: name: Version path: ${{env.GITHUB_HOME}}\output\version.txt # Create the release on the source repo + - name: Create tag for non-rc builds + if: ${{contains('alpha', env.VERSION) || contains('beta', env.VERSION)}} + run: | + git tag $($Env:VERSION) + git push --tags origin - name: Create Release id: create_release + if: ${{contains('rc' env.VERSION)}} # using contributor's version to allow for pointing at the right commit uses: fleskesvor/create-release@feature/support-target-commitish with: @@ -89,6 +95,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Upload the build package to the release - name: Upload Release Package + if: ${{contains('rc' env.VERSION)}} id: upload_release uses: actions/upload-release-asset@v1 with: From 45b6a090678f9f3f0dbc71f8c89d95c27e672613 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 13 May 2020 10:41:27 -0600 Subject: [PATCH 2/6] fixes contain statement - missed a comma --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8a46caf3..31cbd799 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -84,8 +84,8 @@ jobs: git push --tags origin - name: Create Release id: create_release - if: ${{contains('rc' env.VERSION)}} # using contributor's version to allow for pointing at the right commit + if: ${{contains('rc', env.VERSION)}} uses: fleskesvor/create-release@feature/support-target-commitish with: tag_name: ${{ env.VERSION }} From 06cc871432258e6abdce9169723cacad20833ed0 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 13 May 2020 10:45:54 -0600 Subject: [PATCH 3/6] fixes other comma issue... --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 31cbd799..cf01982f 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -95,7 +95,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Upload the build package to the release - name: Upload Release Package - if: ${{contains('rc' env.VERSION)}} + if: ${{contains('rc', env.VERSION)}} id: upload_release uses: actions/upload-release-asset@v1 with: From a4339bf5a4ebdf7dabfc4fcd0eac783fb8425e5d Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 13 May 2020 11:20:36 -0600 Subject: [PATCH 4/6] adjust conditions to NOT use expression syntax --- .github/workflows/docker.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index cf01982f..a43ebf50 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -78,14 +78,14 @@ jobs: path: ${{env.GITHUB_HOME}}\output\version.txt # Create the release on the source repo - name: Create tag for non-rc builds - if: ${{contains('alpha', env.VERSION) || contains('beta', env.VERSION)}} + if: contains('-alpha-', env.VERSION) || contains('-beta-', env.VERSION) run: | git tag $($Env:VERSION) git push --tags origin - name: Create Release id: create_release # using contributor's version to allow for pointing at the right commit - if: ${{contains('rc', env.VERSION)}} + if: contains('-rc-', env.VERSION) || contains('-hotfix-', env.VERSION) uses: fleskesvor/create-release@feature/support-target-commitish with: tag_name: ${{ env.VERSION }} @@ -95,7 +95,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Upload the build package to the release - name: Upload Release Package - if: ${{contains('rc', env.VERSION)}} + if: contains('-rc-', env.VERSION) || contains('-hotfix-', env.VERSION) id: upload_release uses: actions/upload-release-asset@v1 with: From b0a21a1c2f3975340edd8c106ac7b15b22eb5712 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 13 May 2020 11:42:18 -0600 Subject: [PATCH 5/6] fixes order of operations for contains statement --- .github/workflows/docker.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a43ebf50..54d3c1b2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -78,14 +78,14 @@ jobs: path: ${{env.GITHUB_HOME}}\output\version.txt # Create the release on the source repo - name: Create tag for non-rc builds - if: contains('-alpha-', env.VERSION) || contains('-beta-', env.VERSION) + if: contains(env.VERSION, 'alpha') || contains(env.VERSION, 'beta') run: | git tag $($Env:VERSION) git push --tags origin - name: Create Release id: create_release # using contributor's version to allow for pointing at the right commit - if: contains('-rc-', env.VERSION) || contains('-hotfix-', env.VERSION) + if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-') uses: fleskesvor/create-release@feature/support-target-commitish with: tag_name: ${{ env.VERSION }} @@ -95,7 +95,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Upload the build package to the release - name: Upload Release Package - if: contains('-rc-', env.VERSION) || contains('-hotfix-', env.VERSION) + if: contains(env.VERSION,'-rc-') || contains(env.VERSION,'-hotfix-') id: upload_release uses: actions/upload-release-asset@v1 with: @@ -110,6 +110,8 @@ jobs: needs: Build_Project runs-on: windows-latest steps: + - name: check Github ref + run: ${{toJson(github.ref)}} # Checkout the repo - name: Checkout Builds Repo uses: actions/checkout@v2 @@ -188,6 +190,8 @@ jobs: if: contains(github.ref, 'master') || contains(github.ref, 'release') steps: # Checkout the repo + - name: check Github ref + run: ${{toJson(github.ref)}} - name: Checkout Builds Repo uses: actions/checkout@v2 with: From f9ca609c1e59f79aee86584efc4402b9c69b2778 Mon Sep 17 00:00:00 2001 From: Andrew Welker Date: Wed, 13 May 2020 11:56:53 -0600 Subject: [PATCH 6/6] fix to prevent branches with 'release' in the name from triggering the public repo push --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 54d3c1b2..ac1c58be 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -187,7 +187,7 @@ jobs: Public_Push_Output: needs: Build_Project runs-on: windows-latest - if: contains(github.ref, 'master') || contains(github.ref, 'release') + if: contains(github.ref, 'master') || contains(github.ref, '/release/') steps: # Checkout the repo - name: check Github ref