Skip to content

Commit cf1c055

Browse files
committed
feat(FC-1287) Added GA integration with automatic publishing
1 parent fd51912 commit cf1c055

5 files changed

Lines changed: 56 additions & 1 deletion

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: main pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
jobs:
8+
test_libraries:
9+
uses: blockchain/devx-workflows/.github/workflows/library-pipeline.yml@0.0.35
10+
with:
11+
version_script: scripts/version.sh
12+
library_script: scripts/publish_lib.sh
13+
build_docker_image: eu.gcr.io/blockchain-internal/build_common_jvm8-v2
14+
secrets:
15+
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr-pipeline.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: pr pipeline
2+
3+
on:
4+
pull_request:
5+
types: [ opened, synchronize, reopened ]
6+
7+
jobs:
8+
test_libraries:
9+
uses: blockchain/devx-workflows/.github/workflows/library-pipeline.yml@0.0.35
10+
with:
11+
version_script: scripts/version.sh
12+
library_script: scripts/publish_lib.sh
13+
build_docker_image: eu.gcr.io/blockchain-internal/build_common_jvm8-v2
14+
secrets:
15+
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
16+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
allprojects {
22
group = 'com.blockchain.btcd-cli4j'
3-
version = '0.5.8.15'
43
}
54

65
subprojects {

scripts/publish_lib.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
echo "nexusUrl=https://nexus.internal.blockchain.info" >> gradle.properties
4+
echo "nexusUsername=github-actions" >> gradle.properties
5+
echo "nexusPassword=$NEXUS_PASSWORD" >> gradle.properties
6+
echo "gradleCachePassword=" >> gradle.properties
7+
8+
chown -R blockchain:blockchain $PWD
9+
su blockchain -c "./gradlew publish --no-daemon -Pversion=$VERSION" || true

scripts/version.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
BUILD_VERSION=0.5.8
3+
if [ "$GITHUB_REF" = "refs/heads/master" ]
4+
then
5+
LAST_VERSION=$(git tag --sort=-v:refname --merged | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
6+
echo "$LAST_VERSION" | grep -Ev '^$' > /dev/null || exit 1
7+
if [[ "$LAST_VERSION" == ${BUILD_VERSION}.* ]]
8+
then BUILD_NUM=$(( 1 + $( cut -d. -f4 <<< "${LAST_VERSION}") ))
9+
else BUILD_NUM=0
10+
fi
11+
echo "${BUILD_VERSION}.${BUILD_NUM}"
12+
else
13+
GIT_COMMIT=$( git rev-parse --short HEAD )
14+
echo "$GITHUB_HEAD_REF"-"$GIT_COMMIT"
15+
fi

0 commit comments

Comments
 (0)