Skip to content

Commit 6bc303d

Browse files
authored
Merge pull request #302 from KiraCore/v0.1.23-rc.4
V0.1.23 rc.4
2 parents dc6c19a + 5058d21 commit 6bc303d

11 files changed

+1259
-17
lines changed

.github/workflows/branch.yml

+22-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ on:
44
push:
55
branches: [ feature/*, bugfix/* ]
66

7-
# git ls-remote <URL> | head -1 | sed "s/HEAD//"
87
jobs:
9-
# isolate signing & repo cloning from docker image
108
auto-pr:
119
name: Automated Master Branch PR
1210
runs-on: ubuntu-20.04
@@ -22,22 +20,40 @@ jobs:
2220
- name: Extract branch name on pull request
2321
shell: bash
2422
run: |
25-
echo "RELEASE_VER=$(grep -Fn -m 1 'Release: ' ./RELEASE.md | rev | cut -d ":" -f1 | rev | xargs | tr -dc '[:alnum:]\-\.' || echo '')" >> $GITHUB_ENV
26-
echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
23+
chmod -v 777 ./RELEASE.md
24+
RELEASE_VER="$(grep -Fn -m 1 'Release: ' ./RELEASE.md | rev | cut -d ":" -f1 | rev | xargs | tr -dc '[:alnum:]\-\.' || echo '' | xargs)"
25+
echo "RELEASE_VER=$RELEASE_VER" >> $GITHUB_ENV
26+
echo "SOURCE_BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
2727
echo "MASTER_REF=$(git ls-remote https://github.com/kiracore/${{ github.event.repository.name }} | head -1 | sed 's/HEAD//')" >> $GITHUB_ENV
28+
git show-branch "remotes/origin/$RELEASE_VER" && echo "TARGET_BRANCH_EXISTS=true" >> $GITHUB_ENV || echo "TARGET_BRANCH_EXISTS=false" >> $GITHUB_ENV
2829
- name: Print debug data before publishing
2930
run: |
3031
echo "Source branch: ${{ env.SOURCE_BRANCH }}"
3132
echo " Master ref.: ${{ env.MASTER_REF }}"
3233
echo " Release ver.: ${{ env.RELEASE_VER }}"
3334
echo " Event name: ${{ github.event_name }}"
34-
echo " Repo. name: ${{ github.event.repository.name }}"
35+
echo " Repo. name: ${{ github.event.repository.name }}"
36+
echo "Target Exists: ${{ env.TARGET_BRANCH_EXISTS }}"
3537
# ref.: https://github.com/peterjgrainger/action-create-branch, v2.0.1
3638
- name: Create version branch from master
3739
uses: peterjgrainger/action-create-branch@40d33f921267ca130cbacc770f41fc7c501a420f
38-
if: startsWith(env.RELEASE_VER, 'v') && contains(env.RELEASE_VER, '.')
40+
if: |
41+
( env.TARGET_BRANCH_EXISTS == false || env.TARGET_BRANCH_EXISTS == 'false' ) &&
42+
( startsWith(env.RELEASE_VER, 'v') && contains(env.RELEASE_VER, '.') )
3943
env:
4044
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4145
with:
4246
branch: ${{ env.RELEASE_VER }}
4347
sha: ${{ env.MASTER_REF }}
48+
- name: Create PR from feature to version branch
49+
if: |
50+
( env.TARGET_BRANCH_EXISTS == false || env.TARGET_BRANCH_EXISTS == 'false' ) &&
51+
( startsWith(env.RELEASE_VER, 'v') && contains(env.RELEASE_VER, '.') )
52+
uses: repo-sync/pull-request@5ba2c80b97c87b9174c1548141b7acd80f6376e1
53+
with:
54+
github_token: ${{ secrets.REPO_ACCESS }}
55+
source_branch: ${{ env.SOURCE_BRANCH }}
56+
destination_branch: ${{ env.RELEASE_VER}}
57+
pr_title: "${{ env.SOURCE_BRANCH }} -> ${{ env.RELEASE_VER }}"
58+
pr_label: "kira-automation"
59+
pr_allow_empty: true

.github/workflows/main.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
pull-requests: write
4444
needs: [setup]
4545
container:
46-
image: ghcr.io/kiracore/docker/base-image:v0.0.3.0
46+
image: ghcr.io/kiracore/docker/base-image:v0.5.0.0
4747
steps:
4848
- name: Checking dependency versions
4949
run: |
@@ -67,6 +67,7 @@ jobs:
6767
make test
6868
make install
6969
sekaid version
70+
make test-local
7071
- name: Publishing SEKAID binaries
7172
shell: bash
7273
run: |
@@ -81,6 +82,7 @@ jobs:
8182
echo " sekai-linux-arm64.deb: sha256:$(sha256sum ./bin/sekai-linux-arm64.deb | awk '{ print $1 }')" >> ./bin/RELEASE.md
8283
echo "sekai-windows-amd64.exe: sha256:$(sha256sum ./bin/sekai-windows-amd64.exe | awk '{ print $1 }')" >> ./bin/RELEASE.md
8384
echo "sekai-windows-arm64.exe: sha256:$(sha256sum ./bin/sekai-windows-arm64.exe | awk '{ print $1 }')" >> ./bin/RELEASE.md
85+
echo " sekai-utils.sh: sha256:$(sha256sum ./bin/sekai-utils.sh | awk '{ print $1 }')" >> ./bin/RELEASE.md
8486
echo -e "\`\`\`" >> ./bin/RELEASE.md
8587
tar -czvf deb.tar.gz -C ./bin .
8688
- name: Uploading artifacts
@@ -160,6 +162,7 @@ jobs:
160162
./sekai-darwin-arm64.deb
161163
./sekai-windows-amd64.exe
162164
./sekai-windows-arm64.exe
165+
./sekai-utils.sh
163166
# ref: https://github.com/softprops/action-gh-release, v0.1.14
164167
# Release on merge only (push action) - this should run only once
165168
- name: Publish pre-release
@@ -181,6 +184,7 @@ jobs:
181184
./sekai-darwin-arm64.deb
182185
./sekai-windows-amd64.exe
183186
./sekai-windows-arm64.exe
187+
./sekai-utils.sh
184188
# ref.: https://github.com/hmarr/auto-approve-action, v2.1.0
185189
- name: Approve pull request on success
186190
uses: hmarr/auto-approve-action@5d04a5ca6da9aeb8ca9f31a5239b96fc3e003029

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ go.sum: go.mod
99
test:
1010
./scripts/test.sh
1111

12+
test-local:
13+
./scripts/test-local.sh
14+
1215
# look into .golangci.yml for enabling / disabling linters
1316
lint:
1417
@echo "--> Running linter"

RELEASE.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
This is a simple test release
1+
## KIRA Blockchain Application - SEKAI
22

3-
Release: `v0.1.23-rc.3`
3+
Release: `v0.1.23-rc.4`
44

5-
Features:
6-
* NONE, JUST A CI/CD TEST v2
7-
* DO NOT USE IN PRODUCTION
5+
**Features:**
6+
* Added Integration Tests: `network-setup`

scripts/protogen-local.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ UTILS_VER=$(utilsVersion 2> /dev/null || echo "")
88
GO_VER=$(go version 2> /dev/null || echo "")
99
PLATFORM=$(uname) && PLATFORM=$(echo "$PLATFORM" | tr '[:upper:]' '[:lower:]' )
1010

11-
UTILS_OLD_VER="false" && [[ $(versionToNumber "$UTILS_VER" || echo "0") -ge $(versionToNumber "v0.0.15" || echo "1") ]] || UTILS_OLD_VER="true"
11+
UTILS_OLD_VER="false" && [[ $(versionToNumber "$UTILS_VER" || echo "0") -ge $(versionToNumber "v0.0.1.2" || echo "1") ]] || UTILS_OLD_VER="true"
1212

1313
# Installing utils is essential to simplify the setup steps
1414
if [ "$UTILS_OLD_VER" == "true" ] ; then
1515
echo "INFO: KIRA utils were NOT installed on the system, setting up..." && sleep 2
16-
KIRA_UTILS_BRANCH="v0.0.3" && cd /tmp && rm -fv ./i.sh && \
17-
wget https://raw.githubusercontent.com/KiraCore/tools/$KIRA_UTILS_BRANCH/bash-utils/install.sh -O ./i.sh && \
18-
chmod 777 ./i.sh && ./i.sh "$KIRA_UTILS_BRANCH" "/var/kiraglob" && . /etc/profile && loadGlobEnvs
16+
TOOLS_VERSION="v0.0.8.0" && cd /tmp && rm -fv ./utils.sh && \
17+
wget "https://github.com/KiraCore/tools/releases/download/$TOOLS_VERSION/kira-utils.sh" -O ./utils.sh && \
18+
FILE_HASH=$(sha256sum ./utils.sh | awk '{ print $1 }' | xargs || echo -n "") && \
19+
[ "$FILE_HASH" == "1cfb806eec03956319668b0a4f02f2fcc956ed9800070cda1870decfe2e6206e" ] && \
20+
chmod -v 555 ./utils.sh && ./utils.sh utilsSetup ./utils.sh "/var/kiraglob" && . /etc/profile
1921
else
2022
echoInfo "INFO: KIRA utils are up to date, latest version $UTILS_VER" && sleep 2
2123
fi

scripts/publish.sh

+2
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,7 @@ pcgRelease "arm64" "$VERSION" "linux"
6767
pcgRelease "arm64" "$VERSION" "darwin"
6868
pcgRelease "arm64" "$VERSION" "windows"
6969

70+
cp -fv ./scripts/sekai-utils.sh ./bin/sekai-utils.sh
71+
7072
rm -rfv ./bin/amd64 ./bin/arm64 ./bin/deb
7173
echoInfo "INFO: Sucessfully published SEKAI deb packages into ./bin"

0 commit comments

Comments
 (0)