[pull] main from llvm:main #26716
This file contains hidden or 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
| 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@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.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: ubuntu-24.04 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Download container | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| name: container | |
| - name: Push Container | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y skopeo | |
| skopeo login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io | |
| skopeo copy docker-archive:${{ needs.build-ci-container-windows.outputs.container-filename }} \ | |
| --dest-compress-format zstd \ | |
| docker://${{ needs.build-ci-container-windows.outputs.container-name-tag }} | |
| skopeo copy docker-archive:${{ needs.build-ci-container-windows.outputs.container-filename }} \ | |
| --dest-compress-format zstd \ | |
| docker://${{ needs.build-ci-container-windows.outputs.container-name }}:latest |