Skip to content

Commit

Permalink
👷 Updates Publish Workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
brucificus committed Aug 30, 2023
1 parent 1d0c793 commit 1567eb9
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
begin-release:
name: Begin Release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: github.event.workflow_run.conclusion == 'success'
steps:
- run: echo "Beginning release."
- name: "Transfer 'version.json' artifact from triggering workflow"
uses: pwshrc/[email protected].0
- name: "Transfer 'version-json' artifact from triggering workflow"
uses: pwshrc/[email protected].2
with:
name: 'version.json'
name: 'version-json'
- name: "Transfer 'PSGallery-package' artifact from triggering workflow"
uses: pwshrc/[email protected].0
uses: pwshrc/[email protected].2
with:
name: 'PSGallery-package'
- name: "Transfer 'release-notes.md' artifact from triggering workflow"
uses: pwshrc/[email protected].0
- name: "Transfer 'release-notes' artifact from triggering workflow"
uses: pwshrc/[email protected].2
with:
name: 'release-notes.md'
name: 'release-notes'

test-publish-psgallery-package:
name: Test Publish to PSGallery
Expand All @@ -34,19 +34,24 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Populate GitVersion variables
id: gitversion_vars
uses: pwshrc/[email protected]
with:
mode: 'download'
- name: "Get artifact: PSGallery-package"
uses: actions/download-artifact@v3
with:
name: PSGallery-package
path: ./out/
- name: Publish Prerelease to PSGallery (WhatIf)
if: "${{ steps.gitversion_vars.outputs.PreReleaseTag != '' }}"
uses: pwshrc/[email protected].0
if: steps.gitversion_vars.outputs.PreReleaseTag != ''
uses: pwshrc/[email protected].2
with:
run: ./build/publish.ps1 -NUGET_KEY "abc" -Prerelease -WhatIf
- name: Publish Release to PSGallery (WhatIf)
if: "${{ steps.gitversion_vars.outputs.PreReleaseTag == '' }}"
uses: pwshrc/[email protected].0
if: steps.gitversion_vars.outputs.PreReleaseTag == ''
uses: pwshrc/[email protected].2
with:
run: ./build/publish.ps1 -NUGET_KEY "abc" -WhatIf

Expand All @@ -59,7 +64,7 @@ jobs:
uses: actions/checkout@v3
- name: Populate GitVersion variables
id: gitversion_vars
uses: pwshrc/actions-determine-version@v0.3.0
uses: pwshrc/actions-determine-version@v0.8.0
with:
mode: 'download'
- name: "Get artifact: PSGallery-package"
Expand All @@ -68,15 +73,15 @@ jobs:
name: PSGallery-package
path: ./out/
- name: Publish Prerelease to PSGallery
if: "${{ steps.gitversion_vars.outputs.PreReleaseTag != '' }}"
uses: pwshrc/[email protected].0
if: steps.gitversion_vars.outputs.PreReleaseTag != ''
uses: pwshrc/[email protected].2
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
with:
run: ./build/publish.ps1 -NUGET_KEY "$env:NUGET_KEY" -Prerelease
- name: Publish Release to PSGallery
if: "${{ steps.gitversion_vars.outputs.PreReleaseTag == '' }}"
uses: pwshrc/[email protected].0
if: steps.gitversion_vars.outputs.PreReleaseTag == ''
uses: pwshrc/[email protected].2
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
with:
Expand All @@ -89,16 +94,17 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Populate GitVersion variables
- name: Get GitVersion
id: gitversion_vars
uses: pwshrc/actions-determine-version@v0.3.0
uses: pwshrc/actions-determine-version@v0.8.0
with:
mode: 'download'
- name: "Get artifact: release-notes.md"
uses: actions/download-artifact@v3
- name: Get release notes
id: get-releasenotes
uses: pwshrc/[email protected]
with:
name: release-notes.md
path: ./out/
mode: 'download'
github_token: "${{ secrets.GITHUB_TOKEN }}"
- name: "Get artifact: PSGallery-package"
uses: actions/download-artifact@v3
with:
Expand All @@ -113,7 +119,7 @@ jobs:
tag_name: "v${{ steps.gitversion_vars.outputs.SemVer }}"
target_commitish: "${{ steps.gitversion_vars.outputs.Sha }}"
generate_release_notes: false
body_path: ./out/release-notes.md
body_path: ${{ steps.get-releasenotes.outputs.filepath }}
prerelease: "${{ steps.gitversion_vars.outputs.PreReleaseTag != '' }}"
draft: false
files: |
Expand Down

0 comments on commit 1567eb9

Please sign in to comment.