
https://github.com/actions/checkout/releases/tag/v5.0.0 was released a couple of days ago (still new, sufficient bake time that there probably is not a significant security issue). There are few changes, with the most notable ones being dependency bumps, specifically the node version bump to v24. This requires actions runner v2.327.1. I will land this after all of the infrastructure has been moved over to the new runner version.
74 lines
2.9 KiB
YAML
74 lines
2.9 KiB
YAML
name: Build Windows CI Container
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- .github/workflows/build-ci-container-windows.yml
|
|
- '.github/workflows/containers/github-action-ci-windows/**'
|
|
pull_request:
|
|
paths:
|
|
- .github/workflows/build-ci-container-windows.yml
|
|
- '.github/workflows/containers/github-action-ci-windows/**'
|
|
|
|
jobs:
|
|
build-ci-container-windows:
|
|
if: github.repository_owner == 'llvm'
|
|
runs-on: windows-2022
|
|
outputs:
|
|
container-name: ${{ steps.vars.outputs.container-name }}
|
|
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
|
|
container-filename: ${{ steps.vars.outputs.container-filename }}
|
|
steps:
|
|
- name: Checkout LLVM
|
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
with:
|
|
sparse-checkout: .github/workflows/containers/github-action-ci-windows
|
|
- name: Write Variables
|
|
id: vars
|
|
run: |
|
|
$tag = [int64](Get-Date -UFormat %s)
|
|
$container_name="ghcr.io/$env:GITHUB_REPOSITORY_OWNER/ci-windows-2022"
|
|
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
|
|
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
|
|
|
|
push-ci-container:
|
|
if: github.event_name == 'push'
|
|
needs:
|
|
- build-ci-container-windows
|
|
permissions:
|
|
packages: write
|
|
runs-on: windows-2022
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
steps:
|
|
- name: Download container
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
|
with:
|
|
name: container
|
|
- name: Push Container
|
|
run: |
|
|
docker load -i ${{ needs.build-ci-container-windows.outputs.container-filename }}
|
|
docker tag ${{ needs.build-ci-container-windows.outputs.container-name-tag }} ${{ needs.build-ci-container-windows.outputs.container-name }}:latest
|
|
docker login -u ${{ github.actor }} -p $env:GITHUB_TOKEN ghcr.io
|
|
docker push ${{ needs.build-ci-container-windows.outputs.container-name-tag }}
|
|
docker push ${{ needs.build-ci-container-windows.outputs.container-name }}:latest
|