v11.31.1 #149
Workflow file for this run
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: 'PKG: Chocolatey NuGet Release' | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version to release" | |
required: true | |
type: string | |
default: "8.0.0" | |
release: | |
types: [published] | |
jobs: | |
chocotize: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the branch | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Determine which version should be released based on event type | |
- name: Set Version (Workflow Dispatch) | |
shell: bash | |
if: github.event_name == 'workflow_dispatch' | |
run: | | |
echo VERSION=${{ inputs.version }} >> $GITHUB_ENV | |
- name: Set Version (Release Event) | |
if: github.event_name == 'release' | |
run: | | |
echo VERSION=${{ github.event.release.tag_name }} >> $GITHUB_ENV | |
- name: Unified Version | |
id: version | |
shell: bash | |
run: | | |
V=$(echo $VERSION | sed 's/v//') | |
echo "Version: $V" | |
echo "version=${V}" >> $GITHUB_OUTPUT | |
- name: Generate Packages | |
shell: bash | |
run: | | |
cd packages/chocolatey || exit | |
for pkg in cnquery cnspec; do | |
echo "------- GENERATING ${pkg} ----------------------" | |
VERSION=${{ steps.version.outputs.version }} bash ${pkg}-generate.sh | |
echo "" | |
echo "Install script:" | |
cat ${pkg}/tools/chocolateyInstall.ps1 | |
echo "--------" | |
done | |
- name: Update Chocolatey Packages | |
uses: addnab/docker-run-action@v3 | |
with: | |
image: chocolatey/choco:latest | |
options: -v ${{ github.workspace }}/packages/chocolatey:/packages -e CHOCO_API_KEY=${{ secrets.CHOCOLATEY_API_KEY }} -e VERSION=${{ steps.version.outputs.version }} | |
run: | | |
for pkg in cnquery cnspec; do | |
echo "------- PROCESSING ${pkg} ----------------------" | |
cd /packages/$pkg | |
choco apikey --key ${CHOCO_API_KEY} --source https://push.chocolatey.org/ | |
choco pack | |
choco push --source=https://push.chocolatey.org/ | |
done | |
echo 'Go check for the moderation status:' | |
echo 'Mondoo Moderation Queue: https://community.chocolatey.org/packages?q=tag%3Amondoo&moderatorQueue=true&moderationStatus=all-statuses&prerelease=false&sortOrder=relevance' | |