Skip to content

I2::Profiling::Publish #22

I2::Profiling::Publish

I2::Profiling::Publish #22

name: I2::Profiling::Publish
on:
push:
tags:
- 'v2*'
workflow_dispatch:
inputs:
BUILD_DEPLOY_IMAGE:
description: "Choose \"true\" to build and push deploy image"
type: choice
required: true
default: 'false'
options:
- true
- false
CHECKOUT_REF:
required: false
default: main
# IROHA2_DOCKERFILE:
# required: true
# default: Dockerfile.glibc
# IROHA2_PROFILE:
# description: "IROHA2_PROFILE_ARG: Leave \"deploy\" to build and push deploy image"
# required: true
# default: deploy
# IROHA2_RUSTFLAGS:
# description: "IROHA2_RUSTFLAGS: Leave empty to build \"deploy\" image"
# required: false
# default:
# IROHA2_FEATURES:
# description: "IROHA2_FEATURES: Leave empty to build \"deploy\" image"
# required: false
# default:
# IROHA2_CARGOFLAGS:
# description: "IROHA2_CARGOFLAGS: Leave empty to build \"deploy\" image"
# required: false
# default:
env:
IROHA2_DOCKERFILE: Dockerfile.glibc
IROHA2_PROFILE: profiling
IROHA2_RUSTFLAGS: -C force-frame-pointers=on
IROHA2_FEATURES: profiling
IROHA2_CARGOFLAGS: -Z build-std
jobs:
registry-profiling-image:
if: ${{ inputs.BUILD_DEPLOY_IMAGE == 'false' }}
runs-on: [self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
- uses: actions/checkout@v4
- name: Get the release tag
run: |
RELEASE_VERSION=${{ github.ref_name }}
PREFIX='v'
TAG=${RELEASE_VERSION#$PREFIX}
echo "TAG=$TAG" >>$GITHUB_ENV
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Soramitsu Harbor
uses: docker/login-action@v3
with:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Set up Docker Buildx
id: buildx
if: always()
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2-profiling image
uses: docker/build-push-action@v6
if: always()
with:
push: true
tags: |
hyperledger/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
labels: commit=${{ github.sha }}
build-args: |
"PROFILE=${{ env.IROHA2_PROFILE }}"
"RUSTFLAGS=${{ env.IROHA2_RUSTFLAGS }}"
"FEATURES=${{ env.IROHA2_FEATURES }}"
"CARGOFLAGS=${{ env.IROHA2_CARGOFLAGS }}"
file: ${{env.IROHA2_DOCKERFILE }}
# This context specification is required
context: .
registry-deploy-image:
if: ${{ inputs.BUILD_DEPLOY_IMAGE == 'true' }}
runs-on: ubuntu-latest #[self-hosted, Linux, iroha2]
container:
image: hyperledger/iroha2-ci:nightly-2024-04-18
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.CHECKOUT_REF }}
- name: Get the release tag
run: |
RELEASE_VERSION=${{ github.ref_name }}
PREFIX='v'
TAG=${RELEASE_VERSION#$PREFIX}
echo "TAG=$TAG" >>$GITHUB_ENV
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Login to Soramitsu Harbor
# uses: docker/login-action@v3
# with:
# registry: docker.soramitsu.co.jp
# username: ${{ secrets.HARBOR_USERNAME }}
# password: ${{ secrets.HARBOR_TOKEN }}
- name: Set up Docker Buildx
id: buildx
if: always()
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2-profiling image
uses: docker/build-push-action@v6
if: always()
with:
push: true
tags: |
bastos525/iroha:${{ env.TAG }}-deploy
# docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}-${{ env.IROHA2_PROFILE }}
labels: commit=${{ github.sha }}
# build-args: |
# "PROFILE=deploy"
# "RUSTFLAGS=${{ github.event.inputs.IROHA2_RUSTFLAGS }}"
# "FEATURES=${{ github.event.inputs.IROHA2_FEATURES }}"
# "CARGOFLAGS=${{ github.event.inputs.IROHA2_CARGOFLAGS }}"
file: ${{env.IROHA2_DOCKERFILE }}
# This context specification is required
context: .