Skip to content

Commit

Permalink
[ci] #4459: New iroha2-stable images release tags (#4485)
Browse files Browse the repository at this point in the history
* [ci] #4459: New iroha2-stable images release tags

Signed-off-by: BAStos525 <[email protected]>

* [ci] #4459: Fix comments

Signed-off-by: BAStos525 <[email protected]>

* [ci] #4459: Fix profiling name env var

Signed-off-by: BAStos525 <[email protected]>

---------

Signed-off-by: BAStos525 <[email protected]>
  • Loading branch information
BAStos525 authored Apr 19, 2024
1 parent fa03b1a commit eb1da5f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 43 deletions.
54 changes: 24 additions & 30 deletions .github/workflows/iroha2-profiling-image.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,16 @@
name: I2::Profiling::Publish

on:
workflow_dispatch:
inputs:
IROHA2_IMAGE_TAG:
required: true
default: stable
IROHA2_IMAGE_RELEASE:
required: true
IROHA2_DOCKERFILE:
required: true
default: Dockerfile.glibc
IROHA2_PROFILE:
required: true
default: profiling
IROHA2_RUSTFLAGS:
required: false
default: -C force-frame-pointers=on
IROHA2_FEATURES:
required: false
default: profiling
IROHA2_CARGOFLAGS:
required: false
default: -Z build-std
push:
tags:
- 'v2*'

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:
Expand All @@ -31,6 +19,12 @@ jobs:
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 }}
Expand All @@ -47,20 +41,20 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2:profiling-image
- name: Build and push iroha2-profiling image
uses: docker/build-push-action@v5
if: always()
with:
push: true
tags: |
hyperledger/iroha2:${{ github.event.inputs.IROHA2_IMAGE_TAG }}-${{ github.event.inputs.IROHA2_IMAGE_RELEASE }}-profiling
docker.soramitsu.co.jp/iroha2/iroha2:${{ github.event.inputs.IROHA2_IMAGE_TAG }}-${{ github.event.inputs.IROHA2_IMAGE_RELEASE }}-profiling
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=${{ github.event.inputs.IROHA2_PROFILE }}"
"RUSTFLAGS=${{ github.event.inputs.IROHA2_RUSTFLAGS }}"
"FEATURES=${{ github.event.inputs.IROHA2_FEATURES }}"
"CARGOFLAGS=${{ github.event.inputs.IROHA2_CARGOFLAGS }}"
file: ${{ github.event.inputs.IROHA2_DOCKERFILE }}
"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: .
23 changes: 10 additions & 13 deletions .github/workflows/iroha2-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: I2::Release::Publish

on:
push:
branches: [stable, lts]
tags:
- 'v2*'

env:
CARGO_TERM_COLOR: always
Expand All @@ -18,14 +19,12 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Get tag from branch name
- name: Get the release tag
run: |
TAG=${{ github.ref_name }}
RELEASE_VERSION=${{ github.ref_name }}
PREFIX='v'
TAG=${RELEASE_VERSION#$PREFIX}
echo "TAG=$TAG" >>$GITHUB_ENV
- name: Get the release from a branch name
run: |
RELEASE=$(curl -s https://raw.githubusercontent.com/hyperledger/iroha/${{ github.ref_name }}/Cargo.toml | sed -n '3p' | sed -e 's/version = "//g' -e 's/"$//' | tr -d '\n')
echo "RELEASE=$RELEASE" >>$GITHUB_ENV
- name: Build and export to Docker iroha2 image
uses: docker/build-push-action@v5
if: always()
Expand All @@ -34,9 +33,8 @@ jobs:
load: true
file: Dockerfile
tags: |
hyperledger/iroha2:${{ env.TAG }}
hyperledger/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
docker.soramitsu.co.jp/iroha2/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
hyperledger/iroha:${{ env.TAG }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test docker-compose.single.yml before pushing
Expand Down Expand Up @@ -68,9 +66,8 @@ jobs:
context: .
push: true
tags: |
hyperledger/iroha2:${{ env.TAG }}
hyperledger/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
docker.soramitsu.co.jp/iroha2/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
hyperledger/iroha:${{ env.TAG }}
docker.soramitsu.co.jp/iroha2/iroha:${{ env.TAG }}
labels: commit=${{ github.sha }}

configs:
Expand Down

0 comments on commit eb1da5f

Please sign in to comment.