Skip to content

AutoBuildAll

AutoBuildAll #839

Workflow file for this run

name: AutoBuildAll
on:
workflow_dispatch:
schedule:
- cron: '42 7 * * *' # At 0742 each day
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
check_for_new_stable:
runs-on: ubuntu-latest
outputs:
dartversion: ${{ steps.dartversion.outputs.dartversion }}
betaversion: ${{ steps.dartversion.outputs.betaversion }}
steps:
- name: checkout repo content
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- id: dartversion
name: Check stable version
run: |
DDURL="https://raw.githubusercontent.com/dart-lang/dart-docker/main/versions.json"
curl -s $DDURL | jq -r .stable.version > DART_STABLE_VERSION
if [ -z "$(git status --porcelain)" ]; then
if [ "${{ github.event_name }}" != "workflow_dispatch" ]; then
echo 'No new stable release of Dart'
echo "dartversion=NOTNEW" >> $GITHUB_OUTPUT
exit 0
fi
fi
DART_VERSION=$(cat DART_STABLE_VERSION)
BETA_VERSION=$(cat DART_LAST_BETA_VERSION)
echo "dartversion=${DART_VERSION}" >> $GITHUB_OUTPUT
echo "betaversion=${BETA_VERSION}" >> $GITHUB_OUTPUT
build_multi_arch_images:
needs: [check_for_new_stable]
if: ${{ needs.check_for_new_stable.outputs.dartversion != 'NOTNEW' }}
env:
DART_VERSION: ${{ needs.check_for_new_stable.outputs.dartversion }}
BETA_VERSION: ${{ needs.check_for_new_stable.outputs.betaversion }}
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Multi Arch buildimage
id: docker_build1
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
file: ./at-buildimage/Dockerfile
build-args: DART_VERSION=${{ env.DART_VERSION }}
push: true
provenance: false
tags: |
atsigncompany/buildimage:automated
atsigncompany/buildimage:${{ env.DART_VERSION }}
atsigncompany/buildimage:${{ env.DART_VERSION }}_${{ env.BETA_VERSION }}
atsigncompany/buildimage:GHA_${{ github.run_number }}
platforms: |
linux/amd64
linux/arm64/v8
linux/arm/v7
- name: Get SDK SHAs
id: sdk_shas
run: |
function get_beta_sha {
curl -s ${SHAPRE}${BETA_VERSION}${SHAMID}$1${SHAEND} | awk '{print $1}'
}
SHAPRE="https://storage.googleapis.com/dart-archive/channels/beta/release/"
SHAMID="/sdk/dartsdk-linux-"
SHAEND="-release.zip.sha256sum"
echo "X64_SHA=$(get_beta_sha x64)" >> $GITHUB_ENV
echo "ARM_SHA=$(get_beta_sha arm)" >> $GITHUB_ENV
echo "ARM64_SHA=$(get_beta_sha arm64)" >> $GITHUB_ENV
echo "RISCV64_SHA=$(get_beta_sha riscv64)" >> $GITHUB_ENV
- name: Build and push RISC-V buildimage
id: docker_build2
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
file: ./at-buildimage/Dockerfile.RV64
build-args: |
BETA_VERSION=${{ env.BETA_VERSION }}
X64_SHA=${{ env.X64_SHA }}
ARM_SHA=${{ env.ARM_SHA }}
ARM64_SHA=${{ env.ARM64_SHA }}
RISCV64_SHA=${{ env.RISCV64_SHA }}
push: true
provenance: false
tags: |
atsigncompany/buildimage:riscv
atsigncompany/buildimage:riscv-GHA_${{ github.run_number }}
atsigncompany/buildimage:riscv_${{ env.BETA_VERSION }}
platforms: |
linux/riscv64
- name: Combine build images
id: docker_manifest_build
run: |
docker buildx imagetools create -t atsigncompany/buildimage:automated \
--append atsigncompany/buildimage:riscv
docker buildx imagetools create -t atsigncompany/buildimage:${{ env.DART_VERSION }} \
--append atsigncompany/buildimage:riscv
docker buildx imagetools create \
-t atsigncompany/buildimage:${{ env.DART_VERSION }}_${{ env.BETA_VERSION }} \
--append atsigncompany/buildimage:riscv
docker buildx imagetools create -t atsigncompany/buildimage:GHA_${{ github.run_number }} \
--append atsigncompany/buildimage:riscv
- name: Build and push dartshowplatform
id: docker_build3
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
file: ./dartshowplatform/Dockerfile
build-args: DART_VERSION=${{ env.DART_VERSION }}
push: true
provenance: false
tags: |
atsigncompany/dartshowplatform:automated
atsigncompany/dartshowplatform:${{ env.DART_VERSION }}
atsigncompany/dartshowplatform:GHA_${{ github.run_number }}
platforms: |
linux/amd64
linux/arm64/v8
linux/arm/v7
linux/riscv64
- name: Google Chat Notification
uses: Co-qn/google-chat-notification@3691ccf4763537d6e544bc6cdcccc1965799d056 # releases/v1
with:
name: New images build for Dart SDK ${{ env.DART_VERSION }}
url: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
status: ${{ job.status }}
update_version_in_repo:
if: ${{ github.event_name != 'workflow_dispatch' }}
needs: [check_for_new_stable, build_multi_arch_images]
env:
DART_VERSION: ${{ needs.check_for_new_stable.outputs.dartversion }}
runs-on: ubuntu-latest
steps:
- name: checkout_to_update_version
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Update stable version
id: dartversion
run: |
echo "$DART_VERSION" > DART_STABLE_VERSION
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
token: ${{ secrets.MY_GITHUB_TOKEN }}
commit-message: 'chore: Bump DART_VERSION file to match latest Stable release'
committer: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com>
signoff: false
add-paths: .
branch: bot-new-stable-version
delete-branch: true
title: 'chore: New DART_STABLE_VERSION'
body: |
Bumping version tracking file after updating Docker images.
labels: |
operations
assignees: cpswan
reviewers: gkc
draft: false