Skip to content

Update AutoPkgReleaseNupkg.yaml #234

Update AutoPkgReleaseNupkg.yaml

Update AutoPkgReleaseNupkg.yaml #234

---
name: Test AutoPkg Release Nupkg
# based upon: https://github.com/autopkg/recipes/blob/master/AutoPkg/AutoPkgGitMaster.nupkg.recipe
on:
push:
paths:
- ".github/workflows/AutoPkgReleaseNupkg.yaml"
- "AutoPkgRecipe/AutoPkgReleaseSource.download.recipe.yaml"
- "AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml"
pull_request:
paths:
- ".github/workflows/AutoPkgReleaseNupkg.yaml"
- "AutoPkgRecipe/AutoPkgReleaseSource.download.recipe.yaml"
- "AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml"
jobs:
AutoPkgNupkg:
runs-on: windows-latest
steps:
- name: Set token
# required for githubreleaseinfoprovider in github actions
# without this, API limits will be hit
run: |
cd ~
echo ${{ secrets.GITHUB_TOKEN }} > ".autopkg_gh_token"
- uses: actions/checkout@v4
# TODO: switch to using https://github.com/autopkg/setup-autopkg-actions
- name: setup-autopkg local action
uses: ./.github/actions/setup-autopkg
- name: Install requirements
run: pip install --requirement requirements.txt
- name: run test recipe autopkg
run: python autopkg/Code/autopkg run -v Test-Recipes/AutopkgCore.test.recipe.yaml
- name: run nupkg recipe
run: python autopkg/Code/autopkg run -v AutoPkgRecipe/AutoPkgRelease.nupkg.recipe.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: chocolately install python
# python versions: 3.8.10, 3.9.12, 3.10.5, 3.11.4
run: choco install python3 --version 3.10.13 --no-progress --yes --force --force-dependencies
- name: test chocolately install autopkg.nupkg
run: choco install autopkg -s "$env:USERPROFILE\Library\AutoPkg\Cache\com.github.jgstew.nupkg.AutoPkg\nupkgs\" --pre --no-progress --yes --force --verbose
- name: test autopkg chocolately install
run: autopkg run -vv Test-Recipes/AutopkgCore.test.recipe.yaml
- name: Get Choco log contents if failure occurs
if: ${{ failure() }}
# should upload artifact instead
run: cat C:\ProgramData\chocolatey\logs\chocolatey.log
# Related:
# - https://github.com/jgstew/bigfix-content/blob/master/.github/workflows/autopkg.yaml