Skip to content

Commit

Permalink
feat(choco): build choco package when release is created
Browse files Browse the repository at this point in the history
  • Loading branch information
riezebosch committed Jun 13, 2023
1 parent b9d75a2 commit fe2069a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/choco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
on:
release:
types: [published]

name: choco
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: download
run: |
${{ github.event.release }} | jq '.assets[] | select(.name=="gitviz_windows_amd64.exe").browser_download_url' | xargs curl -O --output-dir dist
- name: hash
run: |
shasum -a 256 dist/gitviz_windows_amd64.exe | head -c 40 >> ./choco/tools/LICENSE.txt
- id: version
run: echo "::set-output name=version::$($env:GITHUB_REF.Substring(11))"

- name: choco pack
uses: crazy-max/ghaction-chocolatey@v1
with:
args: pack ./choco/gitviz.nuspec --version ${{ steps.version.outputs.version }}

- name: choco push
uses: crazy-max/ghaction-chocolatey@v1
with:
args: push --api-key=${{ secrets.CHOCOLATEY_APIKEY }}

2 changes: 1 addition & 1 deletion choco/gitviz.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
</metadata>
<files>
<file src="tools\**" target="tools" />
<file src="..\dist\windows\amd64\**" target="tools" />
<file src="..\dist\gitviz_windows_amd64.exe" target="tools/gitviz.exe" />
</files>
</package>

0 comments on commit fe2069a

Please sign in to comment.