-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[wasm] Add
eng/testing/bump-chrome-version.proj
.. which can be used to update `ChromeVersions.props` to the latest stable version.
- Loading branch information
Showing
2 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Update Chrome Version used for wasm testing | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Branch | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email github-actions[bot]@users.noreply.github.com | ||
git checkout -b update-chrome-version-${{ github.run_id }} | ||
- name: Run UpdateToLatestVersion | ||
run: >- | ||
make -C src/mono/wasm build-tasks && | ||
.dotnet/dotnet build src/mono/wasm/bump_chrome_version.proj -p:Configuration=Release && | ||
git add eng/testing/ChromeVersions.props | ||
- name: Check for changes | ||
id: check_changes | ||
run: | | ||
echo "has_changes=$(git diff-index --quiet HEAD && echo false || echo true)" >> $GITHUB_OUTPUT | ||
- name: Commit Update | ||
run: | | ||
echo steps.check_changes.outputs.has_changes=${{steps.check_changes.outputs.has_changes}} | ||
if ${{steps.check_changes.outputs.has_changes}} == 'true'; then | ||
git commit -m "Automated bump of chrome version" | ||
git push --set-upstream origin update-chrome-version-${{ github.run_id }} | ||
else | ||
echo "No changes detected." | ||
fi | ||
- name: Create PR | ||
if: steps.check_changes.outputs.has_changes == 'true' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const { data: pullRequest } = await github.rest.pulls.create({ | ||
base: context.ref, | ||
head: "update-chrome-version-${{ github.run_id }}", | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: '[wasm] Bump chrome version used for testing', | ||
body: '' | ||
}); | ||
await github.rest.pulls.requestReviewers({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
pull_number: pullRequest.number, | ||
reviewers: ["radical"] | ||
}); | ||
return pullRequest.number; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<Project DefaultTargets="UpdateChromeVersion"> | ||
|
||
<Import Project="..\Directory.Build.props" /> | ||
<UsingTask AssemblyFile="$(WasmBuildTasksAssemblyPath)" TaskName="Microsoft.WebAssembly.Build.Tasks.GetChromeVersions" /> | ||
|
||
<Target Name="UpdateChromeVersion"> | ||
<GetChromeVersions | ||
OSIdentifier="linux" | ||
OSPrefix="Linux_x64" | ||
Channel="$(ChromeChannel)" | ||
MaxMajorVersionsToCheck="1" | ||
IntermediateOutputPath="$(ArtifactsObjDir)"> | ||
<Output TaskParameter="ChromeVersion" PropertyName="linux_ChromeVersion" /> | ||
<Output TaskParameter="V8Version" PropertyName="linux_V8Version" /> | ||
<Output TaskParameter="BranchPosition" PropertyName="linux_ChromeRevision" /> | ||
<Output TaskParameter="BaseSnapshotUrl" PropertyName="linux_ChromeBaseSnapshotUrl" /> | ||
</GetChromeVersions> | ||
|
||
<GetChromeVersions | ||
OSIdentifier="win" | ||
OSPrefix="Win_x64" | ||
Channel="$(ChromeChannel)" | ||
MaxMajorVersionsToCheck="1" | ||
IntermediateOutputPath="$(ArtifactsObjDir)"> | ||
<Output TaskParameter="ChromeVersion" PropertyName="win_ChromeVersion" /> | ||
<Output TaskParameter="V8Version" PropertyName="win_V8Version" /> | ||
<Output TaskParameter="BranchPosition" PropertyName="win_ChromeRevision" /> | ||
<Output TaskParameter="BaseSnapshotUrl" PropertyName="win_ChromeBaseSnapshotUrl" /> | ||
</GetChromeVersions> | ||
|
||
<PropertyGroup> | ||
<_PropsContent> | ||
<Project> | ||
<PropertyGroup> | ||
<linux_ChromeVersion>$(linux_ChromeVersion)</linux_ChromeVersion> | ||
<linux_ChromeRevision>$(linux_ChromeRevision)</linux_ChromeRevision> | ||
<linux_ChromeBaseSnapshotUrl>$(linux_ChromeBaseSnapshotUrl)</linux_ChromeBaseSnapshotUrl> | ||
|
||
<win_ChromeVersion>$(win_ChromeVersion)</win_ChromeVersion> | ||
<win_ChromeRevision>$(win_ChromeRevision)</win_ChromeRevision> | ||
<win_ChromeBaseSnapshotUrl>$(win_ChromeBaseSnapshotUrl)</win_ChromeBaseSnapshotUrl> | ||
</PropertyGroup> | ||
</Project> | ||
</_PropsContent> | ||
</PropertyGroup> | ||
<Message Text="Writing version props: $(_PropsContent)" Importance="High" /> | ||
<WriteLinesToFile Lines="$(_PropsContent)" File="$(RepositoryEngineeringDir)testing\ChromeVersions.props" Overwrite="true" /> | ||
</Target> | ||
|
||
<Import Project="..\Directory.Build.targets" /> | ||
|
||
</Project> |