mirror of
https://github.com/wavetermdev/chocolatey.git
synced 2026-08-05 13:47:23 -07:00
setup package
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
name: Choco Auto Update
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
jobs:
|
||||
update_choco_auto:
|
||||
name: update_${{ matrix.package }}
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
matrix:
|
||||
package: [
|
||||
wave
|
||||
]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Install Chocolatey Automatic Package Updater Module
|
||||
run: Install-Module -Name Chocolatey-AU -Force
|
||||
|
||||
- name: Run ${{ matrix.package }} update script
|
||||
id: update
|
||||
run: |
|
||||
cd _auto\${{ matrix.package }}
|
||||
$UpdateOutput = .\update.ps1
|
||||
$NupkgPath = (($UpdateOutput.Result | Where-Object {$_ -like '*.nupkg''*'}) -split "'")[1]
|
||||
Write-Output "NupkgPath=$($NupkgPath)" >> $Env:GITHUB_OUTPUT
|
||||
$UpdateStatus = if ($UpdateOutput.Result -match 'No new version found') {'No Update'} else {'Update Available'}
|
||||
Write-Output "UpdateStatus=$($UpdateStatus)" >> $Env:GITHUB_OUTPUT
|
||||
|
||||
- name: Test ${{ matrix.package }} install
|
||||
run: Test-Package -Install -Nu ${{ steps.update.outputs.NupkgPath }}
|
||||
if: steps.update.outputs.UpdateStatus == 'Update Available'
|
||||
|
||||
- name: Publish to Chocolatey community feed
|
||||
run: |
|
||||
$Nupkg = '${{ steps.update.outputs.NupkgPath }}'
|
||||
$ApiKey = '${{ secrets.CHOCOLATEY_API_KEY }}'
|
||||
$ChocoServer = 'https://push.chocolatey.org/'
|
||||
choco push $Nupkg --source $ChocoServer --key $ApiKey
|
||||
if: steps.update.outputs.UpdateStatus == 'Update Available'
|
||||
|
||||
- name: Commit Updated nuspec
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: Apply Choco package update - ${{ matrix.package }} ${{ steps.update.outputs.newversion }}
|
||||
file_pattern: '*.nuspec *.ps1'
|
||||
if: steps.update.outputs.UpdateStatus == 'Update Available'
|
||||
Reference in New Issue
Block a user