Update Chocolatey #102
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: Update Chocolatey | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Version + Date' | |
required: true | |
default: 1.5.0.XXXXXXXX | |
permissions: | |
contents: read | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
chocolatey: | |
name: Deploy to chocolatey.org | |
runs-on: windows-latest | |
if: github.repository == 'OpenChrom/OpenChromChocolateyPackage' | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Set Checksum | |
id: checksum | |
run: | | |
filename="OpenChrom-${{ github.event.inputs.tag }}-Lablicate-x64.zip" | |
url="https://products.lablicate.com/openchrom/1.5.0/openchrom-lablicate_win32.x86_64_1.5.0.zip" | |
curl -sSL "${url}" -o "${filename}" | |
sha256=$(cat "${filename}" | sha256sum -) | |
sed -i "s/{SHA256CHECKSUM}/${sha256:0:64}/g" "tools/chocolateyinstall.ps1" | |
- name: Set Version | |
id: version | |
run: | | |
tag=${{ github.event.inputs.tag }} | |
version="${tag:0:14}" | |
echo "nuget=$version" >> $GITHUB_OUTPUT | |
sed -i "s/{VERSION}/${version}/g" "openchrom.nuspec" | |
- name: Pack Release | |
run: | | |
choco pack openchrom.nuspec | |
- name: Upload Release | |
run: | | |
choco push openchrom.${{ steps.version.outputs.nuget }}.nupkg -s https://push.chocolatey.org/ -k ${{ secrets.CHOCO_KEY }} |