|  | 
|  | 1 | +name: Package Updater | 
|  | 2 | + | 
|  | 3 | +on: | 
|  | 4 | +  push: | 
|  | 5 | +    branches: [master] | 
|  | 6 | +  workflow_dispatch: | 
|  | 7 | +    inputs: | 
|  | 8 | +      packages: | 
|  | 9 | +        description: "What is the packages (optionally version) you wish to force update on?" | 
|  | 10 | +        required: false | 
|  | 11 | +  schedule: | 
|  | 12 | +    - cron: "0 3 * * *" | 
|  | 13 | + | 
|  | 14 | +jobs: | 
|  | 15 | +  updater: | 
|  | 16 | +    runs-on: windows-2019 | 
|  | 17 | +    env: | 
|  | 18 | +      au_version: master | 
|  | 19 | +      au_push: true | 
|  | 20 | +      github_user_repo: ${{ github.repository }} | 
|  | 21 | +      github_api_key: ${{ secrets.GIST_API_KEY }} | 
|  | 22 | +      gist_id: df9d4f7d314e08279d949ba08f1ec769 | 
|  | 23 | +      nupkg_cache_path: C:\nupkg_cache | 
|  | 24 | +      mail_user: ${{ secrets.MAIL_USER }} | 
|  | 25 | +      mail_pass: ${{ secrets.MAIL_PASSWORD }} | 
|  | 26 | +      mail_server: smtp.gmail.com | 
|  | 27 | +      mail_port: 587 | 
|  | 28 | +      mail_enablessl: true | 
|  | 29 | +      api_key: ${{ secrets.CHOCO_API_KEY }} | 
|  | 30 | +      nuget_artifacts: ${{ github.runner.temp }}/artifacts | 
|  | 31 | + | 
|  | 32 | +    steps: | 
|  | 33 | +      - name: Configure git client | 
|  | 34 | +        run: | | 
|  | 35 | +          git config --global user.email "riedel@teco.edu" | 
|  | 36 | +          git config --global user.name "till" | 
|  | 37 | +          git config --global core.safecrlf false | 
|  | 38 | +      - name: Install Dependencies | 
|  | 39 | +        run: | | 
|  | 40 | +          Set-Service wuauserv -StartupType Manual | 
|  | 41 | +          git clone -q https://github.com/majkinetor/au.git $Env:TEMP/au | 
|  | 42 | +          . "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version | 
|  | 43 | +        shell: powershell | 
|  | 44 | +      - name: System information | 
|  | 45 | +        run: | | 
|  | 46 | +          Get-CimInstance win32_operatingsystem -Property Caption, OSArchitecture, Version | fl Caption, OSArchitecture, Version | 
|  | 47 | +          $PSVersionTable | 
|  | 48 | +          git --version | 
|  | 49 | +          choco --version | 
|  | 50 | +          "Build info" | 
|  | 51 | +          '  {0,-20} {1}' -f 'SCHEDULED BUILD:', ("${{ github.event_name }}" -eq 'schedule') | 
|  | 52 | +          '  {0,-20} {1}' -f 'FORCED BUILD:'   , ("${{ github.event_name }}" -eq 'workflow_dispatch') | 
|  | 53 | +        shell: powershell | 
|  | 54 | +      - uses: actions/checkout@v3.5.0 | 
|  | 55 | +        with: | 
|  | 56 | +          fetch-depth: 0 | 
|  | 57 | +      - name: Run package updater | 
|  | 58 | +        env: | 
|  | 59 | +          FORCED_PACKAGES: ${{ github.event.inputs.packages }} | 
|  | 60 | +        run: | | 
|  | 61 | +          . ./.github/EventLogs.ps1 | 
|  | 62 | +          Clear-EventLogs | 
|  | 63 | +          Remove-Item "$Env:ChocolateyInstall\logs\*.log" | 
|  | 64 | +
 | 
|  | 65 | +          ./update_all.ps1 -ForcedPackages $env:FORCED_PACKAGES | 
|  | 66 | +          Get-EventLogs * | ? Source -eq 'Schannel' | Format-List * | Out-File eventlogs.txt | 
|  | 67 | +        shell: powershell | 
|  | 68 | +      - name: Create diff file | 
|  | 69 | +        run: | | 
|  | 70 | +          git add automatic extension manual templates | 
|  | 71 | +          git diff --cached > unsaved_changes.patch | 
|  | 72 | +      - name: Create au temporary directory | 
|  | 73 | +        run: | | 
|  | 74 | +          if (Test-Path $Env:TEMP\chocolatey\au) { 7z a -mx9 au_temp.7z $Env:TEMP\chocolatey\au\* } | 
|  | 75 | +        shell: powershell | 
|  | 76 | +      - name: Upload artifacts | 
|  | 77 | +        if: always() | 
|  | 78 | +        uses: actions/upload-artifact@v4 | 
|  | 79 | +        with: | 
|  | 80 | +          name: artifacts | 
|  | 81 | +          path: | | 
|  | 82 | +            unsaved_changes.patch | 
|  | 83 | +            au_temp.7z | 
|  | 84 | +            update_info.xml | 
|  | 85 | +            Update-AUPackages.md | 
|  | 86 | +            eventlogs.txt | 
|  | 87 | +            **/*.nupkg | 
|  | 88 | +          retention-days: 5 | 
0 commit comments