-
-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (40 loc) · 1.23 KB
/
choco.yaml
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
on: push
jobs:
test:
# Windows Server 2022 (https://github.com/actions/runner-images)
runs-on: windows-2022
environment: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache Tools
uses: actions/cache@v4
with:
path: $env:TEMP
key: ${{ runner.os }}-cache
- name: Set Choco cache path
run: choco config set cacheLocation $env:TEMP
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.10.x
- name: Set PACKAGE_VERSION
id: version
run: |
echo "PACKAGE_VERSION=$(node -p "require('./choco.json').version")" >> $env:GITHUB_ENV
- name: Choco pack
run: |
choco pack task.nuspec
- name: Choco install
run: |
choco install -y task --source "'.;chocolatey'"
- name: Choco set api key
env:
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
run:
choco apikey --key $env:CHOCOLATEY_API_KEY --source
https://push.chocolatey.org/
- name: Choco publish
run:
choco push task.${{ env.PACKAGE_VERSION }}.nupkg --source
https://push.chocolatey.org/