Skip to content

v1.3.2-rc.2

v1.3.2-rc.2 #70

Workflow file for this run

name: Docker Release Build
on:
release:
types: [released, prereleased]
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get the latest tag
id: get_latest_tag
run: |
git fetch --tags
latest_tag=$(git tag -l | sort -V | tail -n 1)
echo "latest tag: $latest_tag"
echo "LATEST_TAG=$latest_tag" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Docker login
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set latest tag
if: github.event.action == 'released' && github.ref_name == env.LATEST_TAG
run: |
echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},ghcr.io/${{ github.repository }}:latest" >> $GITHUB_ENV
- name: Set alpha tag
if: github.event.action == 'prereleased' && contains(github.ref, 'alpha')
run: |
echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},ghcr.io/${{ github.repository }}:alpha" >> $GITHUB_ENV
- name: Set beta tag
if: github.event.action == 'prereleased' && contains(github.ref, 'beta')
run: |
echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},ghcr.io/${{ github.repository }}:beta" >> $GITHUB_ENV
- name: Set rc tag
if: github.event.action == 'prereleased' && contains(github.ref, 'rc')
run: |
echo "DOCKER_TAGS=${{ env.DOCKER_TAGS }},ghcr.io/${{ github.repository }}:rc" >> $GITHUB_ENV
- name: Set build tag
id: build_tag_generator
run: |
RELEASE_TAG=${{ github.ref_name }}
BUILD_TAG=$RELEASE_TAG-$(date +"%Y%m%d")-$GITHUB_RUN_NUMBER
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
echo "BUILD_TAG=$BUILD_TAG" >> $GITHUB_OUTPUT
echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_OUTPUT
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_OUTPUT
- name: Read manifest.json
id: manifest
run: |
echo "FIREFLY_BUILDER_TAG=$(cat manifest.json | jq -r '.build."firefly-builder".image')" >> $GITHUB_OUTPUT
echo "FABRIC_BUILDER_TAG=$(cat manifest.json | jq -r '.build."fabric-builder".image')" >> $GITHUB_OUTPUT
echo "FABRIC_BUILDER_PLATFORM=$(cat manifest.json | jq -r '.build."fabric-builder".platform')" >> $GITHUB_OUTPUT
echo "SOLIDITY_BUILDER_TAG=$(cat manifest.json | jq -r '.build."solidity-builder".image')" >> $GITHUB_OUTPUT
echo "BASE_TAG=$(cat manifest.json | jq -r '.build.base.image')" >> $GITHUB_OUTPUT
echo "UI_TAG=$(cat manifest.json | jq -r '.ui.tag')" >> $GITHUB_OUTPUT
echo "UI_RELEASE=$(cat manifest.json | jq -r '.ui.release')" >> $GITHUB_OUTPUT
- name: Build and push
uses: docker/build-push-action@v4
with:
provenance: false
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
platforms: linux/amd64
tags: ghcr.io/${{ github.repository }}:${{ steps.build_tag_generator.outputs.RELEASE_TAG }},ghcr.io/${{ github.repository }}:head,${{ env.DOCKER_TAGS }}
labels: |
commit=${{ github.sha }}
build_date=${{ steps.build_tag_generator.outputs.BUILD_DATE }}
tag=${{ steps.build_tag_generator.outputs.RELEASE_TAG }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
build-args: |
FIREFLY_BUILDER_TAG=${{ steps.manifest.outputs.FIREFLY_BUILDER_TAG }}
FABRIC_BUILDER_TAG=${{ steps.manifest.outputs.FABRIC_BUILDER_TAG }}
FABRIC_BUILDER_PLATFORM=${{ steps.manifest.outputs.FABRIC_BUILDER_PLATFORM }}
SOLIDITY_BUILDER_TAG=${{ steps.manifest.outputs.SOLIDITY_BUILDER_TAG }}
BASE_TAG=${{ steps.manifest.outputs.BASE_TAG }}
UI_TAG=${{ steps.manifest.outputs.UI_TAG }}
UI_RELEASE=${{ steps.manifest.outputs.UI_RELEASE }}
BUILD_VERSION=${{ steps.build_tag_generator.outputs.RELEASE_TAG }}
GIT_REF=${{ github.ref }}