Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/main-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: main pipeline

on:
push:
branches:
- 'master'
jobs:
test_libraries:
uses: blockchain/devx-workflows/.github/workflows/[email protected]
with:
version_script: scripts/version.sh
library_script: scripts/publish_lib.sh
build_docker_image: eu.gcr.io/blockchain-internal/build_common_jvm8-v2
secrets:
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions .github/workflows/pr-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pr pipeline

on:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
test_libraries:
uses: blockchain/devx-workflows/.github/workflows/[email protected]
with:
version_script: scripts/version.sh
library_script: scripts/publish_lib.sh
build_docker_image: eu.gcr.io/blockchain-internal/build_common_jvm8-v2
secrets:
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
allprojects {
group = 'com.blockchain.btcd-cli4j'
version = '0.5.8.16'
}

subprojects {
Expand Down
9 changes: 9 additions & 0 deletions scripts/publish_lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

echo "nexusUrl=https://nexus.internal.blockchain.info" >> gradle.properties
echo "nexusUsername=github-actions" >> gradle.properties
echo "nexusPassword=$NEXUS_PASSWORD" >> gradle.properties
echo "gradleCachePassword=" >> gradle.properties

chown -R blockchain:blockchain $PWD
su blockchain -c "./gradlew publish --no-daemon -Pversion=$VERSION" || true
15 changes: 15 additions & 0 deletions scripts/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
BUILD_VERSION=0.5.8
if [ "$GITHUB_REF" = "refs/heads/master" ]
then
LAST_VERSION=$(git tag --sort=-v:refname --merged | grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
echo "$LAST_VERSION" | grep -Ev '^$' > /dev/null || exit 1
if [[ "$LAST_VERSION" == ${BUILD_VERSION}.* ]]
then BUILD_NUM=$(( 1 + $( cut -d. -f4 <<< "${LAST_VERSION}") ))
else BUILD_NUM=0
fi
echo "${BUILD_VERSION}.${BUILD_NUM}"
else
GIT_COMMIT=$( git rev-parse --short HEAD )
echo "$GITHUB_HEAD_REF"-"$GIT_COMMIT"
fi