Skip to content

Merge branch 'add-bgToken' into 'dev' #79

Merge branch 'add-bgToken' into 'dev'

Merge branch 'add-bgToken' into 'dev' #79

Workflow file for this run

name: RELEASE
on:
push:
branches:
- dev
tags:
- '*'
pull_request:
types:
- opened
- synchronize
jobs:
tests:
name: Tests
strategy:
matrix:
os: [ ubuntu-latest ]
scala: [ 2.12.7 ]
java: [ adopt@1.8 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch (full)
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v10
with:
java-version: ${{ matrix.java }}
- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Runs tests
run: |
sbt ++${{ matrix.scala }} test
export-data:
name: export chain data
permissions: write-all
if: github.event_name != 'pull_request'
needs: tests
strategy:
matrix:
os: [ ubuntu-latest ]
scala: [ 2.12.7 ]
java: [ adopt@1.8 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}
- name: Cache sbt
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
- name: Build App
run: |
sbt ++${{ matrix.scala }} assembly
- name: RUN Jar File for push to master
if: github.ref_type == 'branch'
id: set-version
run: |
VERSION_STRING=$(sbt -Dsbt.supershell=false -error "print version")
APP_VERSION_STRING=$(echo "${VERSION_STRING:0:5}")-$(git rev-parse --short HEAD)
echo APP_VERSION=$APP_VERSION_STRING >> "$GITHUB_OUTPUT"
ROSEN=$(find . -name 'contract-rosen-bridge-*.jar')
java -jar $ROSEN all --version $APP_VERSION_STRING
- name: Upload JSON files
uses: softprops/action-gh-release@v1
if: github.ref_type == 'branch'
with:
tag_name: ${{ steps.set-version.outputs.APP_VERSION }}
prerelease: true
files: |
contracts-*.json
tokensMap-*.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: git-sync
uses: wei/git-sync@v3
with:
source_repo: ${GITHUB_REPOSITORY}
source_branch: "refs/tags/*"
destination_repo: 'https://${{ secrets.DESTINATION_USER }}:${{ secrets.DESTINATION_TOKEN }}@${{ secrets.DESTINATION_SERVER }}/ergo/${GITHUB_REPOSITORY}.git'
destination_branch: "refs/tags/*"
- name: RUN Jar File release
if: github.ref_type == 'tag'
run: |
ROSEN=$(find . -name 'contract-rosen-bridge-*.jar')
java -jar $ROSEN all --version ${{ github.ref_name }}
- name: Upload JSON files
uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag'
with:
files: |
contracts-*.json
tokensMap-*.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}