Skip to content

Publish to chocolatey #14

Publish to chocolatey

Publish to chocolatey #14

name: Publish to chocolatey
on:
workflow_dispatch:
inputs:
VERSION:
description: "The release version of kbcli; i.e. v0.5.1'"
type: string
required: true
default: ''
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
jobs:
get-version:
name: Get Version
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: remove prefix v
id: get_version
run: |
version=`bash ${{ github.workspace }}/.github/utils/utils.sh \
--type 1 \
--tag-name ${{ inputs.VERSION }}`
echo "::set-output name=version::$version"
publish:
needs: get-version
name: publish kbcli Chocolately
runs-on: windows-2019
defaults:
run:
shell: powershell
env:
VERSION: ${{ needs.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
repository: apecloud/chocolatey-packages
path: chocolatey
token: ${{ env.GITHUB_TOKEN }}
- name: Chocolately version
run: choco --version
- name: Install AU
run: choco install au
- name: Build Package
working-directory: chocolatey/kbcli
run: |
./update.ps1
- name: Test Package Installer
working-directory: chocolatey/kbcli
run: Test-Package $Install
- name: Push Package to Chocolatey
run: |
Push-Package kbcli.
working-directory: chocolatey/kbcli
env:
api_key: ${{ secrets.CHOCO_API_KEY }}
- uses: EndBug/add-and-commit@v7
with:
message: "publish kbcli on Chocolatey ${{ github.event.inputs.version }}"
add: "."
cwd: "chocolatey"