diff --git a/.github/workflows/build-ci-container-windows.yml b/.github/workflows/build-ci-container-windows.yml index 068cb58301080..0d5a37814c8fc 100644 --- a/.github/workflows/build-ci-container-windows.yml +++ b/.github/workflows/build-ci-container-windows.yml @@ -19,8 +19,10 @@ on: jobs: build-ci-container-windows: - if: github.repository_owner == 'llvm' - runs-on: windows-2019 + # if: github.repository_owner == 'llvm' + runs-on: windows-2022 + permissions: + packages: write outputs: container-name: ${{ steps.vars.outputs.container-name }} container-name-tag: ${{ steps.vars.outputs.container-name-tag }} @@ -34,23 +36,29 @@ jobs: id: vars run: | $tag = [int64](Get-Date -UFormat %s) - $container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2019" + $container_name="ghcr.io/$($env:GITHUB_REPOSITORY_OWNER.ToLower())/ci-windows-2019" echo "container-name=${container_name}" >> $env:GITHUB_OUTPUT echo "container-name-tag=${container_name}:${tag}" >> $env:GITHUB_OUTPUT echo "container-filename=ci-windows-${tag}.tar" >> $env:GITHUB_OUTPUT - name: Build Container working-directory: .github/workflows/containers/github-action-ci-windows + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | docker build -t ${{ steps.vars.outputs.container-name-tag }} . - - name: Save container image - run: | - docker save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }} - - name: Upload container image - uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 - with: - name: container - path: ${{ steps.vars.outputs.container-filename }} - retention-days: 14 + docker tag ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}:latest + docker login -u ${{ github.actor }} -p $env:GITHUB_TOKEN ghcr.io + docker push ${{ steps.vars.outputs.container-name-tag }} + docker push ${{ steps.vars.outputs.container-name }}:latest + # - name: Save container image + # run: | + # docker save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }} + # - name: Upload container image + # uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 + # with: + # name: container + # path: ${{ steps.vars.outputs.container-filename }} + # retention-days: 14 push-ci-container: if: github.event_name == 'push' @@ -58,7 +66,7 @@ jobs: - build-ci-container-windows permissions: packages: write - runs-on: windows-2019 + runs-on: windows-2022 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: diff --git a/.github/workflows/containers/github-action-ci-windows/Dockerfile b/.github/workflows/containers/github-action-ci-windows/Dockerfile index eafe45fac8ea4..9a89909855218 100644 --- a/.github/workflows/containers/github-action-ci-windows/Dockerfile +++ b/.github/workflows/containers/github-action-ci-windows/Dockerfile @@ -1,17 +1,17 @@ # Agent image for LLVM org cluster. # .net 4.8 is required by chocolately package manager. -FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 +FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 # Restore the default Windows shell for correct batch processing. SHELL ["cmd", "/S", "/C"] # Download the Build Tools bootstrapper. -ADD https://aka.ms/vs/16/release/vs_buildtools.exe /TEMP/vs_buildtools.exe +ADD https://aka.ms/vs/17/release/vs_buildtools.exe /TEMP/vs_buildtools.exe RUN powershell -Command Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) # Download channel for fixed install. -ARG CHANNEL_URL=https://aka.ms/vs/16/release/channel +ARG CHANNEL_URL=https://aka.ms/vs/17/release/channel ADD ${CHANNEL_URL} /TEMP/VisualStudio.chman # Install Build Tools with C++ workload. @@ -39,7 +39,8 @@ RUN regsvr32 /S "C:\BuildTools\DIA SDK\bin\amd64\msdia140.dll" & \ # install tools as described in https://llvm.org/docs/GettingStartedVS.html # and a few more that were not documented... -RUN choco install -y ninja git sccache +# make is needed by LLDB tests +RUN choco install -y ninja git sccache make # Pin an older version of Python; the current Python 3.10 fails when # doing "pip install" for the other dependencies, as it fails to find libxml # while compiling some package.