Skip to content

Workflow file for this run

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 }}-temp-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 load/choco/task.nuspec --out load/choco
- name: Choco install
run: |
choco install -y task --source "'./load/choco;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
env:
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
run:
choco push --key $env:CHOCOLATEY_API_KEY load/choco/task.${{ env.PACKAGE_VERSION }}.nupkg --source
https://push.chocolatey.org/