π Package Update #645
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Package Update | |
on: | |
schedule: | |
- cron: '30 18 * * *' | |
workflow_dispatch: | |
inputs: | |
parameters: | |
description: 'Parameters for updater' | |
required: false | |
jobs: | |
update-choco-packages: | |
runs-on: windows-latest | |
needs: update-aur-packages | |
steps: | |
- name: π Checkout | |
uses: actions/checkout@v3 | |
- name: π οΈ Install & Import AU | |
shell: powershell | |
run: | | |
Set-PSRepository PSGallery -InstallationPolicy Trusted | |
Install-Module au | |
Import-Module au | |
- name: π« Set Chocolatey api key | |
run: | | |
choco apikey --key ${{ secrets.CHOCO_API_KEY }} --source https://push.chocolatey.org/ | |
- name: π§ Run update script | |
shell: powershell | |
run: | | |
$Env:au_Push = $true | |
.\update_all.ps1 ${{ github.event.inputs.parameters }} | |
- name: π Fetch newest repo version | |
run: | | |
git pull origin main | |
- name: π Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: 'feat: πΌ Update chocolatey packages' | |
branch: 'main' | |
get-aur-packages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: 𧬠Generate matrix | |
id: gen-matrix | |
run: | | |
matrix=$(find ./packages/ -type f -name '*PKGBUILD' -not -path '*spacedrive*' -not -path '*shfmt-bin*' | sed -r 's|/[^/]+$||' | sort | uniq | cut -f3 -d'/' | jq -R | jq -cs) | |
echo $matrix | |
echo "::set-output name=packages::$matrix" | |
outputs: | |
packages: ${{ steps.gen-matrix.outputs.packages }} | |
update-aur-packages: | |
name: π Publish updated packages | |
needs: get-aur-packages | |
uses: kamack38/packages/.github/workflows/_CD-AUR.yml@main | |
with: | |
packages: ${{ needs.get-aur-packages.outputs.packages }} | |
secrets: | |
AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
KNOWN_HOSTS: ${{ secrets.KNOWN_HOSTS }} | |
AUR_EMAIL: ${{ secrets.AUR_EMAIL }} | |
AUR_USERNAME: ${{ secrets.AUR_USERNAME }} |