Skip to content
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

Win runner build for 23.lts.1+ #472

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/main_win.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ jobs:
uses: ./.github/actions/docker_win
with:
service: ${{ needs.initialize.outputs.docker_service }}
- name: Build runner docker image
id: build-runner-docker-image
uses: ./.github/actions/docker_win
with:
service: ${{ needs.initialize.outputs.docker_runner_service }}
# Runs builds.
build:
needs: [initialize]
Expand Down
2 changes: 2 additions & 0 deletions docker/windows/base/build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ COPY ./spin.ps1 /spin.ps1
# of the execution, i.e. the full invocation string.
COPY ./list_python_processes.py /list_python_processes.py

# Pin Choco to 1.4.0 to avoid required reboot in 2.0.0
ENV chocolateyVersion '1.4.0'
# Install deps via chocolatey.
RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'));`
mkdir C:\choco-cache;`
Expand Down
34 changes: 34 additions & 0 deletions docker/windows/runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2022 The Cobalt Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM cobalt-build-win32-base

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';$ProgressPreference='silentlyContinue';"]

ARG RUNNER_VERSION

RUN Invoke-WebRequest -Uri 'https://aka.ms/install-powershell.ps1' -OutFile install-powershell.ps1; \
powershell -ExecutionPolicy Unrestricted -File ./install-powershell.ps1 -AddToPath

RUN Invoke-WebRequest -Uri https://github.com/actions/runner/releases/download/v$env:RUNNER_VERSION/actions-runner-win-x64-$env:RUNNER_VERSION.zip -OutFile runner.zip; \
Expand-Archive -Path C:/runner.zip -DestinationPath C:/actions-runner; \
Remove-Item -Path C:\runner.zip; \
setx /M PATH $(${Env:PATH} + \";${Env:ProgramFiles}\Git\bin\")

# Required for packaging artifacts.
RUN choco install -f -y 7zip --version=19.0

ENV TMP "C:\Users\ContainerAdministrator\AppData\Local\Temp2"

ADD runner.ps1 C:/runner.ps1
CMD ["pwsh", "-ExecutionPolicy", "Unrestricted", "-File", ".\\runner.ps1"]
2 changes: 2 additions & 0 deletions docker/windows/runner/runner.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.\actions-runner\config.cmd --unattended --replace --url https://github.com/${env:RUNNER_REPO} --token $env:RUNNER_TOKEN --name $env:RUNNER_NAME --work $env:RUNNER_WORKDIR --labels $env:RUNNER_LABELS;
.\actions-runner\run.cmd;
Loading