Skip to content

Commit

Permalink
bump to ltsc2022
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyifan committed Jan 23, 2024
1 parent 11507c0 commit aaadeef
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/trigger-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
trigger:
runs-on: windows-2019
runs-on: windows-2022

strategy:
matrix:
Expand All @@ -19,7 +19,7 @@ jobs:
with:
ref: ${{ github.ref }}
- name: Check if image is up-to-date, and build if not
run: .\check-and-build.ps1 $env:TRAIN $env:USERNAME $env:PASSWORD
run: .\check-and-build.ps1 $env:TRAIN ${{ github.actor }} ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }}
env:
TRAIN: ${{ matrix.train }}
USERNAME: ${{ secrets.DOCKER_USERNAME }}
Expand Down
8 changes: 4 additions & 4 deletions beta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2019
FROM mcr.microsoft.com/windows/servercore:ltsc2022

SHELL ["cmd", "/S", "/C"]

# Install the Visual Studio Build Tools.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe /vs_buildtools.exe
ADD https://aka.ms/vs/17/release/vs_buildtools.exe /vs_buildtools.exe
RUN vs_buildtools.exe --quiet --wait --norestart --nocache \
--installPath C:\BuildTools \
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \
--add Microsoft.Component.MSBuild \
--add Microsoft.VisualStudio.Component.Windows10SDK.17763 \
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 \
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \
|| IF "%ERRORLEVEL%"=="3010" EXIT 0
RUN del vs_buildtools.exe
Expand Down
18 changes: 10 additions & 8 deletions check-and-build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ param (
[String]
$username,
[String]
$password
$password,
[String]
$registry
)

$ErrorActionPreference = "Stop"
Expand All @@ -28,12 +30,12 @@ $latestToolchainVer = ( `
).split('"')[2].trim()
echo "--> Latest toolchain version: rustc $latestToolchainVer"

docker pull yodal/rust-windows:${train}
docker pull ghcr.io/automesh-network/rust-windows:${train}
if($LASTEXITCODE) {
exit $LASTEXITCODE
}
$currentImageVer = ( `
(docker run --rm yodal/rust-windows:${train} rustc -V) `
(docker run --rm ghcr.io/automesh-network/rust-windows:${train} rustc -V) `
| Select-String -Pattern "rustc" `
| Select-Object -Expand Line `
).trim()
Expand All @@ -45,28 +47,28 @@ echo "--> Current image toolchain version: $currentImageVer"
if("rustc $latestToolchainVer" -ne "$currentImageVer") {
echo "--> Image is out-of-date, rebuilding iamge"

docker build -t yodal/rust-windows:${train} -f .\${train}\Dockerfile .
docker build -t ghcr.io/automesh-network/rust-windows:${train} -f .\${train}\Dockerfile .
if($LASTEXITCODE) {
exit $LASTEXITCODE
}

if($username -and $password) {
docker login -u $username -p $password
docker login -u $username -p $password $registry
if($LASTEXITCODE) {
exit $LASTEXITCODE
}

docker push yodal/rust-windows:${train}
docker push ghcr.io/automesh-network/rust-windows:${train}
if($LASTEXITCODE) {
exit $LASTEXITCODE
}

if($train -eq "stable") {
docker tag yodal/rust-windows:stable yodal/rust-windows:latest
docker tag ghcr.io/automesh-network/rust-windows:stable ghcr.io/automesh-network/rust-windows:latest
if($LASTEXITCODE) {
exit $LASTEXITCODE
}
docker push yodal/rust-windows:latest
docker push ghcr.io/automesh-network/rust-windows:latest
if($LASTEXITCODE) {
exit $LASTEXITCODE
}
Expand Down
8 changes: 4 additions & 4 deletions nightly/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2019
FROM mcr.microsoft.com/windows/servercore:ltsc2022

SHELL ["cmd", "/S", "/C"]

# Install the Visual Studio Build Tools.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe /vs_buildtools.exe
ADD https://aka.ms/vs/17/release/vs_buildtools.exe /vs_buildtools.exe
RUN vs_buildtools.exe --quiet --wait --norestart --nocache \
--installPath C:\BuildTools \
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \
--add Microsoft.Component.MSBuild \
--add Microsoft.VisualStudio.Component.Windows10SDK.17763 \
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 \
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \
|| IF "%ERRORLEVEL%"=="3010" EXIT 0
RUN del vs_buildtools.exe
Expand Down
8 changes: 4 additions & 4 deletions stable/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2019
FROM mcr.microsoft.com/windows/servercore:ltsc2022

SHELL ["cmd", "/S", "/C"]

# Install the Visual Studio Build Tools.
ADD https://aka.ms/vs/16/release/vs_buildtools.exe /vs_buildtools.exe
ADD https://aka.ms/vs/17/release/vs_buildtools.exe /vs_buildtools.exe
RUN vs_buildtools.exe --quiet --wait --norestart --nocache \
--installPath C:\BuildTools \
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2022\BuildTools" \
--add Microsoft.Component.MSBuild \
--add Microsoft.VisualStudio.Component.Windows10SDK.17763 \
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 \
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \
|| IF "%ERRORLEVEL%"=="3010" EXIT 0
RUN del vs_buildtools.exe
Expand Down

0 comments on commit aaadeef

Please sign in to comment.