Skip to content

Commit

Permalink
feat: take release version if event is release
Browse files Browse the repository at this point in the history
  • Loading branch information
Shurtu-gal committed Oct 21, 2023
1 parent cfa0bd6 commit eb20f86
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions .github/workflows/release-chocolatey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,27 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Set Version
id: release_version
run: |
if ( "${{ github.event_name }}" -eq "workflow_dispatch" ) {
$version = "${{ github.event.inputs.version }}"
}
else {
$version = "${{ github.event.release.tag_name }}" -replace "^v", ""
}
echo "Setting version to $version"
echo "::set-output name=version::$version"
- name: Make nuspec from the template
run: |
cd ./deploy/chocolatey
pwsh -File ./replace.ps1 -version ${{ github.event.inputs.version }}
pwsh -File ./replace.ps1 -version ${{ steps.release_version.outputs.version }}
- name: Run Chocolatey Pack
run: |
cd ./deploy/chocolatey
choco pack ./asyncapi-cli.nuspec
choco apikey add --source "'https://push.chocolatey.org/'" --key ${{ secrets.CHOCOLATEY_API_KEY }}
choco push ./asyncapi.${{ github.event.inputs.version }}.nupkg --source "'https://push.chocolatey.org/'"
choco push ./asyncapi.${{ steps.release_version.outputs.version }}.nupkg --source "'https://push.chocolatey.org/'"

0 comments on commit eb20f86

Please sign in to comment.