forked from hyperledger-iroha/iroha
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (77 loc) · 2.59 KB
/
iroha2-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: I2::Release::Publish
on:
push:
branches: [iroha2-stable, iroha2-lts]
env:
CARGO_TERM_COLOR: always
jobs:
registry:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Get tag from branch name
run: |
BRANCH=${{ github.ref_name }}
PREFIX='iroha2-'
TAG=${BRANCH#$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: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Soramitsu Harbor
uses: docker/login-action@v2
with:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Build and push iroha2 image
uses: docker/build-push-action@v4
with:
push: true
tags: |
hyperledger/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
docker.soramitsu.co.jp/iroha2/iroha2:${{ env.TAG }}-${{ env.RELEASE }}
labels: commit=${{ github.sha }}
build-args: TAG=${{ env.TAG }}
file: Dockerfile
# This context specification is required
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
configs:
runs-on: ubuntu-latest
container:
image: hyperledger/iroha2-ci:nightly-2023-06-25
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: iroha2-dev
token: ${{ secrets.G_ACCESS_TOKEN }}
- name: Update configs
run: |
./scripts/update_configs.sh lts
./scripts/update_configs.sh stable
- name: Commit config changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[documentation]: Update lts/stable configs following a release'
branch: iroha2-dev
commit_options: '--signoff'
commit_user_name: sorabot
commit_user_email: <>
commit_author: sorabot <[email protected]>