From b9d5067a5d43f938750fbafbdd724791a9759490 Mon Sep 17 00:00:00 2001 From: Michael LoPresti Date: Sun, 15 Oct 2023 19:31:30 -0700 Subject: [PATCH] Created seperate psgallery_release job --- .github/workflows/ci.github-action.yml | 41 ++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.github-action.yml b/.github/workflows/ci.github-action.yml index 725ddd3..5d184ce 100644 --- a/.github/workflows/ci.github-action.yml +++ b/.github/workflows/ci.github-action.yml @@ -73,12 +73,12 @@ jobs: path: dist/ValidateJson.zip retention-days: 7 - release: + gh_release: needs: package permissions: contents: write runs-on: windows-latest - # if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' + if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' defaults: run: shell: ${{ env.SHELL }} @@ -137,11 +137,40 @@ jobs: files: | ValidateJson-${{ steps.version.outputs.version_number }}.zip + psgallery_release: + needs: package + runs-on: windows-latest + # if: ${{ github.ref == 'refs/heads/main' }} + defaults: + run: + shell: ${{ env.SHELL }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Environment + uses: "./.github/template/setup" + with: + shell: ${{ env.SHELL }} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Build Prod Tag + id: prod_tag + if: github.ref == 'refs/heads/main' + env: + VERSION: ${{ steps.version.outputs.version_number }} + RUN_ID: ${{ github.run_id }} + run: | + Write-Output "tag=latest" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + Write-Output "release_name=v$env:VERSION" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + + - name: Get Merged Pull Request + id: merged_pr + uses: actions-ecosystem/action-get-merged-pull-request@v1.0.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Publish to Powershell Gallery - # if: ${{ github.ref == 'refs/heads/main' }} env: NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} RELEASE_NOTES: ${{ steps.merged_pr.body || github.event.pull_request.description || 'GITHUB TEST DEPLOY' }} - run: | - Install-Module "InvokeBuild" -Scope CurrentUser -Force - Invoke-Build publish + run: Invoke-Build publish