|
| 1 | +name: ESR Watcher + Build (Self-hosted Windows) |
| 2 | + |
| 3 | +on: |
| 4 | + schedule: |
| 5 | + - cron: '17 9 * * *' |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + version: |
| 9 | + description: 'Optional version override (example: 140.8.0). Leave empty to run check_esr_update.ps1.' |
| 10 | + required: false |
| 11 | + type: string |
| 12 | + publish_draft: |
| 13 | + description: 'If true, allow draft release publishing (otherwise force -NoPublish).' |
| 14 | + required: false |
| 15 | + default: false |
| 16 | + type: boolean |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + runs-on: [self-hosted, windows] |
| 21 | + |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - name: Resolve run mode |
| 29 | + id: mode |
| 30 | + shell: powershell |
| 31 | + run: | |
| 32 | + $version = "${{ inputs.version }}" |
| 33 | + $isManual = "${{ github.event_name }}" -eq "workflow_dispatch" |
| 34 | +
|
| 35 | + if ($isManual -and -not [string]::IsNullOrWhiteSpace($version)) { |
| 36 | + "run_mode=manual_version" >> $env:GITHUB_OUTPUT |
| 37 | + "version=$version" >> $env:GITHUB_OUTPUT |
| 38 | + } else { |
| 39 | + "run_mode=esr_check" >> $env:GITHUB_OUTPUT |
| 40 | + "version=" >> $env:GITHUB_OUTPUT |
| 41 | + } |
| 42 | +
|
| 43 | + - name: Run check_esr_update.ps1 (default: -NoPublish) |
| 44 | + if: steps.mode.outputs.run_mode == 'esr_check' |
| 45 | + shell: powershell |
| 46 | + env: |
| 47 | + GH_TOKEN: ${{ secrets.DUCKSTEPS_GH_TOKEN }} |
| 48 | + run: | |
| 49 | + $publishDraft = "${{ inputs.publish_draft }}" -eq "true" |
| 50 | + $args = @('-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', '.\scripts\check_esr_update.ps1') |
| 51 | +
|
| 52 | + if (-not $publishDraft) { |
| 53 | + $args += '-NoPublish' |
| 54 | + } |
| 55 | +
|
| 56 | + powershell @args |
| 57 | +
|
| 58 | + - name: Run build_and_release.ps1 (manual version, default: -NoPublish) |
| 59 | + if: steps.mode.outputs.run_mode == 'manual_version' |
| 60 | + shell: powershell |
| 61 | + env: |
| 62 | + GH_TOKEN: ${{ secrets.DUCKSTEPS_GH_TOKEN }} |
| 63 | + run: | |
| 64 | + $publishDraft = "${{ inputs.publish_draft }}" -eq "true" |
| 65 | + $version = "${{ steps.mode.outputs.version }}" |
| 66 | +
|
| 67 | + $args = @( |
| 68 | + '-NoProfile', |
| 69 | + '-ExecutionPolicy', 'Bypass', |
| 70 | + '-File', '.\scripts\build_and_release.ps1', |
| 71 | + '-Version', $version |
| 72 | + ) |
| 73 | +
|
| 74 | + if (-not $publishDraft) { |
| 75 | + $args += '-NoPublish' |
| 76 | + } |
| 77 | +
|
| 78 | + powershell @args |
| 79 | +
|
| 80 | + - name: Upload installer artifacts |
| 81 | + if: always() |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: ducksteps-installer |
| 85 | + if-no-files-found: warn |
| 86 | + path: | |
| 87 | + D:\ducksteps-obj\esr140\dist\ducksteps-*-Setup.exe |
| 88 | + D:\ducksteps-obj\esr140\dist\install\sea\*.installer.exe |
| 89 | +
|
| 90 | + - name: Upload standalone artifacts |
| 91 | + if: always() |
| 92 | + uses: actions/upload-artifact@v4 |
| 93 | + with: |
| 94 | + name: ducksteps-standalone |
| 95 | + if-no-files-found: warn |
| 96 | + path: | |
| 97 | + D:\ducksteps-obj\esr140\dist\ducksteps-*-Standalone.7z |
| 98 | + D:\ducksteps-obj\esr140\dist\*.win64.zip |
| 99 | +
|
| 100 | + - name: Upload logs |
| 101 | + if: always() |
| 102 | + uses: actions/upload-artifact@v4 |
| 103 | + with: |
| 104 | + name: ducksteps-logs |
| 105 | + if-no-files-found: warn |
| 106 | + path: | |
| 107 | + D:\ducksteps-obj\esr140\dist\logs\*.log |
| 108 | + D:\ducksteps-obj\esr140\dist\RELEASE_NOTES.md |
0 commit comments