-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (63 loc) · 1.78 KB
/
publish-kbcli-choco.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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"