diff --git a/.github/workflows/build-operations-metrics-container.yml b/.github/workflows/build-operations-metrics-container.yml index ff5c429ef..ed3bd44f2 100644 --- a/.github/workflows/build-operations-metrics-container.yml +++ b/.github/workflows/build-operations-metrics-container.yml @@ -19,39 +19,16 @@ jobs: build-operations-metrics-container: if: github.repository_owner == 'llvm' runs-on: ubuntu-24.04 - 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 Zorg uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: sparse-checkout: premerge/ops-container - - name: Write Variables - id: vars - run: | - tag=`date +%s` - container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/operations-metrics" - echo "container-name=$container_name" >> $GITHUB_OUTPUT - echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT - echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT - name: Build Container - working-directory: premerge/ops-container - run: | - podman build -t ${{ steps.vars.outputs.container-name-tag }} . - # Save the container so we have it in case the push fails. This also - # allows us to separate the push step into a different job so we can - # maintain minimal permissions while building the container. - - name: Save Container Image - run: | - podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }} - - name: Upload Container Image - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: llvm/llvm-project/.github/actions/build-container@883aa1207e0319362f9b9907158520d28f45fb72 with: - name: container - path: ${{ steps.vars.outputs.container-filename }} - retention-days: 14 + container-name: operations-metrics + context: premerge/ops-container push-operations-metrics-container: if: github.event_name == 'push' @@ -63,14 +40,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Download Container Image - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + - uses: llvm/llvm-project/.github/actions/push-container@883aa1207e0319362f9b9907158520d28f45fb72 with: - name: container - - name: Push Container - run: | - podman load -i ${{ needs.build-operations-metrics-container.outputs.container-filename }} - podman tag ${{ needs.build-operations-metrics-container.outputs.container-name-tag }} ${{ needs.build-operations-metrics-container.outputs.container-name }}:latest - podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io - podman push ${{ needs.build-operations-metrics-container.outputs.container-name-tag }} - podman push ${{ needs.build-operations-metrics-container.outputs.container-name }}:latest + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build-premerge-advisor-container.yml b/.github/workflows/build-premerge-advisor-container.yml index a85791184..9a921b683 100644 --- a/.github/workflows/build-premerge-advisor-container.yml +++ b/.github/workflows/build-premerge-advisor-container.yml @@ -19,39 +19,16 @@ jobs: build-premerge-advisor-container: if: github.repository_owner == 'llvm' runs-on: ubuntu-24.04 - 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 Zorg uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: sparse-checkout: premerge/advisor - - name: Write Variables - id: vars - run: | - tag=`date +%s` - container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/premerge-advisor" - echo "container-name=$container_name" >> $GITHUB_OUTPUT - echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT - echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT - name: Build Container - working-directory: premerge/advisor - run: | - podman build -t ${{ steps.vars.outputs.container-name-tag }} . - # Save the container so we have it in case the push fails. This also - # allows us to separate the push step into a different job so we can - # maintain minimal permissions while building the container. - - name: Save Container Image - run: | - podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }} - - name: Upload Container Image - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: llvm/llvm-project/.github/actions/build-container@883aa1207e0319362f9b9907158520d28f45fb72 with: - name: container - path: ${{ steps.vars.outputs.container-filename }} - retention-days: 14 + container-name: premerge-advisor + context: premerge/advisor push-premerge-advisor-container: if: github.event_name == 'push' @@ -63,14 +40,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Download Container Image - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + - uses: llvm/llvm-project/.github/actions/push-container@883aa1207e0319362f9b9907158520d28f45fb72 with: - name: container - - name: Push Container - run: | - podman load -i ${{ needs.build-premerge-advisor-container.outputs.container-filename }} - podman tag ${{ needs.build-premerge-advisor-container.outputs.container-name-tag }} ${{ needs.build-premerge-advisor-container.outputs.container-name }}:latest - podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io - podman push ${{ needs.build-premerge-advisor-container.outputs.container-name-tag }} - podman push ${{ needs.build-premerge-advisor-container.outputs.container-name }}:latest + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/build-premerge-buildbot-container.yml b/.github/workflows/build-premerge-buildbot-container.yml index b61f18abc..88aac7f84 100644 --- a/.github/workflows/build-premerge-buildbot-container.yml +++ b/.github/workflows/build-premerge-buildbot-container.yml @@ -19,39 +19,16 @@ jobs: build-premerge-buildbot-container: if: github.repository_owner == 'llvm' runs-on: ubuntu-24.04 - 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 Zorg uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: sparse-checkout: premerge/buildbot - - name: Write Variables - id: vars - run: | - tag=`date +%s` - container_name="ghcr.io/$GITHUB_REPOSITORY_OWNER/premerge-buildbot" - echo "container-name=$container_name" >> $GITHUB_OUTPUT - echo "container-name-tag=$container_name:$tag" >> $GITHUB_OUTPUT - echo "container-filename=$(echo $container_name:$tag | sed -e 's/\//-/g' -e 's/:/-/g').tar" >> $GITHUB_OUTPUT - name: Build Container - working-directory: ./premerge/buildbot - run: | - podman build -t ${{ steps.vars.outputs.container-name-tag }} -f Dockerfile . - # Save the container so we have it in case the push fails. This also - # allows us to separate the push step into a different job so we can - # maintain minimal permissions while building the container. - - name: Save Container Image - run: | - podman save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }} - - name: Upload Container Image - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0 + uses: llvm/llvm-project/.github/actions/build-container@e30dc12640a21a0c25a4ca60e30fb56a6745a57b with: - name: container - path: ${{ steps.vars.outputs.container-filename }} - retention-days: 14 + container-name: premerge-buildbot + context: premerge/buildbot push-premerge-buildbot-container: if: github.event_name == 'push' @@ -63,14 +40,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - - name: Download Container Image - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 + - uses: llvm/llvm-project/.github/actions/push-container@e30dc12640a21a0c25a4ca60e30fb56a6745a57b with: - name: container - - name: Push Container - run: | - podman load -i ${{ needs.build-premerge-buildbot-container.outputs.container-filename }} - podman tag ${{ needs.build-premerge-buildbot-container.outputs.container-name-tag }} ${{ needs.build-premerge-buildbot-container.outputs.container-name }}:latest - podman login -u ${{ github.actor }} -p $GITHUB_TOKEN ghcr.io - podman push ${{ needs.build-premerge-buildbot-container.outputs.container-name-tag }} - podman push ${{ needs.build-premerge-buildbot-container.outputs.container-name }}:latest + token: ${{ secrets.GITHUB_TOKEN }}