-
Notifications
You must be signed in to change notification settings - Fork 887
Add WinGet/Homebrew installer dogfood flows for PR builds #17115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
42db8e9
dac0025
56d6f21
c9c2e4c
45052ba
1912371
c90bb0e
e49b2f0
3280694
e8fce4f
95b8713
2d90625
3763a14
cdab0f8
eb507fd
8eb08aa
548668b
a08bf7e
496fc65
c621e1d
eba8cfc
b6cd238
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| name: Prepare installer artifacts | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| installer: | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| prepare_installer_artifacts: | ||
| name: Prepare ${{ inputs.installer == 'winget' && 'WinGet manifests' || 'Homebrew cask' }} | ||
| runs-on: ${{ inputs.installer == 'winget' && 'windows-latest' || 'macos-latest' }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | ||
| with: | ||
| global-json-file: global.json | ||
|
|
||
| - name: Download CLI archives | ||
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| pattern: ${{ inputs.installer == 'winget' && 'cli-native-archives-win-*' || 'cli-native-archives-osx-*' }} | ||
| path: ${{ github.workspace }}/native-archives | ||
| merge-multiple: false | ||
|
|
||
| - name: Prepare WinGet manifest artifact | ||
| if: ${{ inputs.installer == 'winget' }} | ||
| shell: pwsh | ||
| run: | | ||
| $ErrorActionPreference = 'Stop' | ||
| & "$env:GITHUB_WORKSPACE/eng/winget/prepare-manifest-artifact.ps1" ` | ||
| -Channel prerelease ` | ||
| -ArchiveRoot "$env:GITHUB_WORKSPACE/native-archives" ` | ||
| -OutputPath "$env:GITHUB_WORKSPACE/artifacts/installers/winget-manifests" ` | ||
| -ValidationMode Offline | ||
|
|
||
| - name: Prepare Homebrew cask artifact | ||
| if: ${{ inputs.installer == 'homebrew' }} | ||
| shell: bash | ||
| env: | ||
| # Authenticate the upstream-cask existence check inside | ||
| # validate-cask-artifact.sh; unauthenticated requests hit the 60/hour | ||
| # shared rate limit and return 403. | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: > | ||
| eng/homebrew/prepare-cask-artifact.sh | ||
| --channel prerelease | ||
| --archive-root "${GITHUB_WORKSPACE}/native-archives" | ||
| --output-dir "${GITHUB_WORKSPACE}/artifacts/installers/homebrew-cask" | ||
| --validation-mode Offline | ||
|
|
||
| - name: Dogfood install (real winget install) | ||
| if: ${{ inputs.installer == 'winget' }} | ||
| shell: pwsh | ||
| run: | | ||
| $ErrorActionPreference = 'Stop' | ||
| & "$env:GITHUB_WORKSPACE/eng/winget/dogfood.ps1" ` | ||
| -ManifestPath "$env:GITHUB_WORKSPACE/artifacts/installers/winget-manifests" ` | ||
| -ArchiveRoot "$env:GITHUB_WORKSPACE/native-archives" ` | ||
| -Force | ||
|
|
||
| - name: Dogfood install (real brew install) | ||
| if: ${{ inputs.installer == 'homebrew' }} | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| eng/homebrew/dogfood.sh \ | ||
| --archive-root "${GITHUB_WORKSPACE}/native-archives" \ | ||
| "${GITHUB_WORKSPACE}/artifacts/installers/homebrew-cask/aspire.rb" | ||
|
|
||
| - name: Smoke test installed CLI (aspire new + restore) | ||
| if: ${{ inputs.installer == 'winget' }} | ||
| shell: pwsh | ||
| run: | | ||
| $ErrorActionPreference = 'Stop' | ||
| # winget added the shim under %LOCALAPPDATA%\Microsoft\WinGet\Links during the | ||
| # preceding step in this job. The runner shell that started before the install | ||
| # does not yet have that directory on PATH, so prepend it here. | ||
| $env:PATH = "$env:LOCALAPPDATA\Microsoft\WinGet\Links;" + $env:PATH | ||
| & "$env:GITHUB_WORKSPACE/eng/scripts/smoke-installed-cli.ps1" | ||
|
|
||
| - name: Smoke test installed CLI (aspire new + restore) | ||
| if: ${{ inputs.installer == 'homebrew' }} | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| # brew linked the binary into /opt/homebrew/bin which is already on PATH. | ||
| eng/scripts/smoke-installed-cli.sh | ||
|
|
||
| - name: Collect Aspire CLI logs (Windows) | ||
| if: ${{ always() && inputs.installer == 'winget' }} | ||
| shell: pwsh | ||
| run: | | ||
| $ErrorActionPreference = 'Stop' | ||
| $source = Join-Path $HOME ".aspire\logs" | ||
| $destination = Join-Path $env:RUNNER_TEMP "aspire-cli-logs" | ||
| if (Test-Path $source) { | ||
| New-Item -ItemType Directory -Path $destination -Force | Out-Null | ||
| Copy-Item -Path $source -Destination $destination -Recurse -Force | ||
| } else { | ||
| Write-Host "No Aspire CLI logs found at $source" | ||
| } | ||
|
|
||
| - name: Collect Aspire CLI logs (macOS) | ||
| if: ${{ always() && inputs.installer == 'homebrew' }} | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| source="${HOME}/.aspire/logs" | ||
| destination="${RUNNER_TEMP}/aspire-cli-logs" | ||
| if [[ -d "$source" ]]; then | ||
| mkdir -p "$destination" | ||
| cp -R "$source" "$destination/" | ||
| else | ||
| echo "No Aspire CLI logs found at $source" | ||
| fi | ||
|
|
||
| - name: Upload Aspire CLI logs | ||
| if: always() | ||
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | ||
| with: | ||
| name: ${{ inputs.installer == 'winget' && 'winget-aspire-cli-logs' || 'homebrew-aspire-cli-logs' }} | ||
| path: ${{ runner.temp }}/aspire-cli-logs | ||
| if-no-files-found: ignore | ||
| retention-days: 15 | ||
|
|
||
| - name: Upload installer artifact | ||
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | ||
| with: | ||
| name: ${{ inputs.installer == 'winget' && 'winget-manifests-prerelease' || 'homebrew-cask-prerelease' }} | ||
| path: ${{ github.workspace }}/${{ inputs.installer == 'winget' && 'artifacts/installers/winget-manifests' || 'artifacts/installers/homebrew-cask' }} | ||
| if-no-files-found: error | ||
| retention-days: 15 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,33 @@ jobs: | |
| versionOverrideArg: ${{ inputs.versionOverrideArg }} | ||
| targets: '[{"os": "macos-latest", "runner": "macos-latest", "rids": "osx-arm64"}]' | ||
|
|
||
| build_cli_archive_macos_x64: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that you've decided to make these workflows run as part of every PR. I'm not necessarily opposed to that, but as you know, getting CI runners has been a problem lately and this would just add to it. I know the convenience of installing PR builds with winget/homebrew is nice, but that feels like perhaps not fully necessary since we have the scripts too for that purpose. My ultimate question: Would it be better to have these jobs only run if you are making changes that could potentially break the installers (so look for changes on specific paths) or do you think it is likely to introduce regressions even when making changes that are not affecting the code that modifies the way these manifests are generated?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan to add that with the conditional runs for jobs and tests on PR CI. And it will cover this, so it gets run only when we have relevant changes. |
||
| name: Build native CLI archive (macOS x64) | ||
| uses: ./.github/workflows/build-cli-native-archives.yml | ||
| with: | ||
| versionOverrideArg: ${{ inputs.versionOverrideArg }} | ||
| targets: '[{"os": "macos-15-intel", "runner": "macos-15-intel", "rids": "osx-x64"}]' | ||
|
|
||
| prepare_winget_installer_artifacts: | ||
| name: Prepare WinGet installer artifacts | ||
| uses: ./.github/workflows/prepare-installer-artifacts.yml | ||
| needs: [ | ||
| build_cli_archive_windows, | ||
| build_cli_archive_windows_arm64, | ||
| ] | ||
| with: | ||
| installer: winget | ||
|
|
||
| prepare_homebrew_installer_artifacts: | ||
| name: Prepare Homebrew installer artifacts | ||
| uses: ./.github/workflows/prepare-installer-artifacts.yml | ||
| needs: [ | ||
| build_cli_archive_macos, | ||
| build_cli_archive_macos_x64, | ||
| ] | ||
| with: | ||
| installer: homebrew | ||
|
|
||
| build_cli_e2e_image: | ||
| name: Build CLI E2E Docker image | ||
| uses: ./.github/workflows/build-cli-e2e-image.yml | ||
|
|
@@ -332,6 +359,9 @@ jobs: | |
| build_cli_archive_windows, | ||
| build_cli_archive_windows_arm64, | ||
| build_cli_archive_macos, | ||
| build_cli_archive_macos_x64, | ||
| prepare_winget_installer_artifacts, | ||
| prepare_homebrew_installer_artifacts, | ||
| build_cli_e2e_image, | ||
| extension_tests_win, | ||
| cli_starter_validation_windows, | ||
|
|
@@ -349,6 +379,10 @@ jobs: | |
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Create test results directory | ||
| shell: bash | ||
| run: mkdir -p "${{ github.workspace }}/testresults" | ||
|
|
||
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | ||
| with: | ||
| pattern: logs-*-ubuntu-latest | ||
|
|
@@ -421,6 +455,9 @@ jobs: | |
| needs.cli_starter_validation_windows.result == 'skipped' || | ||
| needs.typescript_sdk_tests.result == 'skipped' || | ||
| needs.typescript_api_compat.result == 'skipped' || | ||
| needs.build_cli_archive_macos_x64.result == 'skipped' || | ||
| needs.prepare_winget_installer_artifacts.result == 'skipped' || | ||
| needs.prepare_homebrew_installer_artifacts.result == 'skipped' || | ||
| needs.tests_no_nugets.result == 'skipped' || | ||
| needs.tests_requires_nugets_linux.result == 'skipped' || | ||
| needs.tests_requires_nugets_windows.result == 'skipped' || | ||
|
|
@@ -432,14 +469,17 @@ jobs: | |
| needs.polyglot_validation.result == 'skipped')) || | ||
| (github.event_name != 'pull_request' && | ||
| (needs.extension_tests_win.result == 'skipped' || | ||
| needs.typescript_sdk_tests.result == 'skipped' || | ||
| needs.tests_no_nugets.result == 'skipped' || | ||
| needs.tests_requires_nugets_linux.result == 'skipped' || | ||
| needs.tests_requires_nugets_windows.result == 'skipped' || | ||
| (github.ref == 'refs/heads/main' && | ||
| needs.polyglot_validation.result == 'skipped') || | ||
| (fromJson(needs.setup_for_tests.outputs.tests_matrix_requires_nugets_macos).include[0] != null && | ||
| needs.tests_requires_nugets_macos.result == 'skipped')))) }} | ||
| needs.typescript_sdk_tests.result == 'skipped' || | ||
| needs.build_cli_archive_macos_x64.result == 'skipped' || | ||
| needs.prepare_winget_installer_artifacts.result == 'skipped' || | ||
| needs.prepare_homebrew_installer_artifacts.result == 'skipped' || | ||
| needs.tests_no_nugets.result == 'skipped' || | ||
| needs.tests_requires_nugets_linux.result == 'skipped' || | ||
| needs.tests_requires_nugets_windows.result == 'skipped' || | ||
| (github.ref == 'refs/heads/main' && | ||
| needs.polyglot_validation.result == 'skipped') || | ||
| (fromJson(needs.setup_for_tests.outputs.tests_matrix_requires_nugets_macos).include[0] != null && | ||
| needs.tests_requires_nugets_macos.result == 'skipped')))) }} | ||
| run: | | ||
| echo "One or more dependent jobs failed." | ||
| exit 1 | ||
Uh oh!
There was an error while loading. Please reload this page.