Skip to content

choco

choco #15

Workflow file for this run

name: choco
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
tag:
description: The tag to run against. This trigger runs the GoReleaser and MSI builder.
required: true
jobs:
release:
name: Deploy to chocolatey
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Normalize tag values
shell: bash
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]] ; then
VER=${{ github.event.inputs.tag }}
else
VER=${GITHUB_REF/refs\/tags\//}
fi
VERSION=${VER//v}
echo "VER_TAG=$VER" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PowerShell module cache
id: cacher
uses: actions/cache@v3
with:
path: "C:\\Users\\runneradmin\\Documents\\PowerShell\\Modules"
key: ${{ runner.os }}-InvokeBuild
- name: Install required PowerShell modules
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module InvokeBuild -ErrorAction Stop
- name: Invoke build script
env:
appName: saml2aws
shell: pwsh
run: Invoke-Build
- name: Test
run: go test -v .
- name: Deploy
shell: pwsh
env:
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
VERSION: ${{ env.VERSION }}
run: |

Check failure on line 67 in .github/workflows/choco.yml

View workflow run for this annotation

GitHub Actions / choco

Invalid workflow file

The workflow is not valid. .github/workflows/choco.yml (Line: 67, Col: 14): Unexpected symbol: '$env:CHOCOLATEY_API_KEY'. Located at position 1 within expression: $env:CHOCOLATEY_API_KEY
choco apiKey --key ${{ $env:CHOCOLATEY_API_KEY }} --source "https://push.chocolatey.org/"
choco push ./choco/saml2aws.${{ $env:VERSION }}.nupkg --source "https://push.chocolatey.org/"