Describe ToT docker image version as head commit short sha #309
Workflow file for this run
This file contains 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: Artifacts | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/artifacts.yaml' | |
- 'tools/buildimage/**' | |
push: | |
branches: | |
- main | |
jobs: | |
export-debs: | |
runs-on: ubuntu-22.04 | |
container: | |
image: debian@sha256:4cb3f4198e4af2d03dffe6bfa4f3686773596494ef298f3882553d52e885634b # debian:bullseye-20240110 | |
steps: | |
- name: apt update | |
run: apt update -y && apt upgrade -y | |
- name: install sudo | |
run: apt install -y sudo | |
- name: Checkout repository | |
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 | |
- name: Build debs | |
run: | | |
bash tools/buildutils/build_packages.sh | |
ls -la *.deb | |
- name: Build debs.tar | |
run: find . -name 'cuttlefish-*.deb' -print0 | tar -cvf debs.tar --null --files-from - | |
- name: Publish debs.tar | |
uses: actions/upload-artifact@v3 | |
with: | |
name: debs | |
path: debs.tar | |
export-gce-image: | |
needs: export-debs | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free space | |
run: rm -rf /opt/hostedtoolcache | |
- name: Checkout repository | |
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 | |
- name: Download debs.tar | |
uses: actions/download-artifact@v3 | |
with: | |
name: debs | |
- name: Untar debs.tar | |
run: tar -xf debs.tar | |
- name: Build image | |
run: bash tools/buildimage/main.sh | |
- name: Publish image | |
uses: actions/upload-artifact@v3 | |
with: | |
name: image_gce_debian11_amd64 | |
path: image.tar.gz | |
export-docker-image-x86_64: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 | |
- name: Get docker image name | |
run: | | |
short_sha=$(echo ${{ github.sha }} | cut -c1-8) | |
echo "x86_64_image_path=orchestration-image-x86_64-${short_sha}.tar" >> $GITHUB_ENV | |
- name: Install bazel | |
run: sudo bash tools/buildutils/installbazel.sh | |
- name: bazel version | |
run: bazel version | |
- name: Build docker image | |
run: bazel build --sandbox_writable_path=$HOME //docker:orchestration_image_tar | |
- name: Set filename of docker image | |
run: mv bazel-bin/docker/orchestration-image.tar ${{ env.x86_64_image_path }} | |
- name: Publish docker image | |
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0 | |
with: | |
name: docker-image-x86_64 | |
path: ${{ env.x86_64_image_path }} | |
export-docker-image-arm64: | |
runs-on: arm-ubuntu-arm-22.04-4core | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675 # aka v2 | |
- name: Get docker image name | |
run: | | |
short_sha=$(echo ${{ github.sha }} | cut -c1-8) | |
echo "arm64_image_path=orchestration-image-arm64-${short_sha}.tar" >> $GITHUB_ENV | |
- name: Install bazel | |
run: sudo bash tools/buildutils/installbazel.sh | |
- name: bazel version | |
run: bazel version | |
- name: Build docker image | |
run: bazel build --sandbox_writable_path=$HOME //docker:orchestration_image_tar | |
- name: Set filename of docker image | |
run: mv bazel-bin/docker/orchestration-image.tar ${{ env.arm64_image_path }} | |
- name: Publish docker image | |
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # aka v4.0.0 | |
with: | |
name: docker-image-arm64 | |
path: ${{ env.arm64_image_path }} |