Choco Release #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Choco Release | |
on: | |
workflow_run: | |
workflows: ["build-and-release"] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
choco-release: | |
name: release choco | |
runs-on: windows-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: get version | |
shell: bash | |
run: | | |
echo "VERSION=$(curl --silent https://api.github.com/repos/animo/siera-cli/releases | jq '.[0]' | jq -r .tag_name)" >> $GITHUB_ENV | |
- name: update nuspec | |
shell: bash | |
run: | | |
cd pkg/choco | |
python3 modify_nuspec.py ${{ env.VERSION }} | |
- name: update choco folder | |
shell: bash | |
run: | | |
cd pkg/choco | |
cp ../../LICENSE tools/LICENSE.txt | |
cd tools | |
curl -L https://github.com/animo/siera-cli/releases/download/${{ env.VERSION }}/windows-x86_64-siera.exe -o windows-x86_64-siera.exe | |
SHA_256=$(sha256sum windows-x86_64-siera.exe | awk '{ print $1 }') | |
sed -i -e "3s|.*|\"$SHA_256\"|" VERIFICATION.txt | |
- name: update choco folder | |
shell: pwsh | |
run: | | |
cd .\pkg\choco | |
choco pack .\siera.nuspec | |
Get-ChildItem *.nupkg | ren -NewName siera.nupkg | |
choco apikey --key ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org/ | |
choco push siera.nupkg --source https://push.chocolatey.org/ |