This repository has been archived by the owner on Oct 10, 2023. It is now read-only.
update #64
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 Releases | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version to release" | |
required: true | |
type: string | |
default: "8.0.0" | |
repository_dispatch: | |
types: [update] | |
jobs: | |
chocotize: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the branch | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# 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 (Repository Dispatch) | |
if: github.event_name == 'repository_dispatch' | |
shell: bash | |
run: | | |
echo VERSION=${{ github.event.client_payload.version }} >> $GITHUB_ENV | |
- name: Unified Version | |
id: version | |
shell: bash | |
run: | | |
echo "Version: $VERSION" | |
echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
- name: Generate Packages | |
shell: bash | |
run: | | |
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 -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' | |