Skip to content

Commit

Permalink
Merge pull request #34 from portto/release/0.5.0
Browse files Browse the repository at this point in the history
Release 0.5.0
  • Loading branch information
imjacklai authored May 21, 2023
2 parents 97984bd + 7f1d91f commit 26e330b
Show file tree
Hide file tree
Showing 43 changed files with 674 additions and 288 deletions.
38 changes: 0 additions & 38 deletions .circleci/config.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Setup

description: Setup

inputs:
google_services:
description: 'Google Services file'
required: true

runs:
using: "composite"
steps:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}

- name: Check Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Put Google Services file
env:
GOOGLE_SERVICES: ${{ inputs.google_services }}
run: echo "$GOOGLE_SERVICES" | base64 -d > app/google-services.json
shell: bash
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Ticket
<!-- Please provide the link associated with the PR -->

## Changes
<!-- Please list the main changes within the PR -->

## Screenshots
<!-- Please attach the screenshots if applicable -->
140 changes: 140 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: CI

on: push

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup
with:
google_services: ${{ secrets.GOOGLE_SERVICES }}

- name: Run lint
run: ./gradlew lint

test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup
with:
google_services: ${{ secrets.GOOGLE_SERVICES }}

- name: Run test
run: ./gradlew test

build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [ lint, test ]
steps:
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup
with:
google_services: ${{ secrets.GOOGLE_SERVICES }}

- name: Build release
run: ./gradlew clean assembleRelease --stacktrace

distribute:
if: startsWith(github.ref_name, 'release/')
name: Distribute
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
steps:
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup
with:
google_services: ${{ secrets.GOOGLE_SERVICES }}

- name: Put files
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
SIGNING: ${{ secrets.SIGNING }}
APP_DISTRIBUTION: ${{ secrets.APP_DISTRIBUTION }}
run: |
echo "Adding files"
TMP_SECRETS_PATH=secrets
mkdir ${TMP_SECRETS_PATH}
echo $KEYSTORE | base64 -d > "${TMP_SECRETS_PATH}"/portto.jjs
echo $SIGNING | base64 -d > "${TMP_SECRETS_PATH}"/signing.properties
echo $APP_DISTRIBUTION | base64 -d > "${TMP_SECRETS_PATH}"/app-distribution.json
echo "All files Added ✅"
- name: Fill Infura id
run: sed -i 's/INFURA_ID.*/INFURA_ID = \"${{ secrets.INFURA_ID }}\"/' app/src/main/java/com/portto/valuedapp/Config.kt

- name: Distribute sample app
run: bash ./scripts/distribute.sh

publish:
if: github.ref_name == 'main'
name: Publish
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
steps:
- uses: actions/checkout@v3

- name: Setup
uses: ./.github/actions/setup
with:
google_services: ${{ secrets.GOOGLE_SERVICES }}

- name: Publish library
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
run: bash ./scripts/publish.sh

- name: Get version
run: |
echo "version=$(grep "versionName" dependencies.gradle | awk -F: '{print $2}' | tr -d ' '\',)" >> $GITHUB_ENV
- name: Create and push tag
run: |
git config user.name "GitHub Actions"
git config user.email [email protected]
git tag -a ${{ env.version }} -m "Release v${{ env.version }}"
git push origin ${{ env.version }}
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: v${{ env.version }}
tag_name: ${{ env.version }}
draft: false
prerelease: false

- name: Create pull request (main -> develop)
run: >
gh pr create
--base develop
--head main
--title '[${{ env.version }}] Merge main into develop'
--body 'Created by Github Actions'
--reviewer Doge-is-Dope,kihonyoo,imjacklai
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .github/workflows/create-asana-attachment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Asana
on:
pull_request:
types: [opened, reopened]

jobs:
create-asana-attachment-job:
runs-on: ubuntu-latest
name: Create pull request attachments on Asana tasks
steps:
- name: Create pull request attachments
uses: Asana/create-app-attachment-github-action@latest
id: postAttachment
with:
asana-secret: ${{ secrets.ASANA_SECRET }}
- name: Log output status
run: echo "Status is ${{ steps.postAttachment.outputs.status }}"
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
# BloctoSDK

![Maven Central](https://img.shields.io/maven-central/v/com.portto.sdk/core)
![CircleCI](https://img.shields.io/circleci/build/gh/portto/blocto-android-sdk/main)
![Github Action](https://github.com/portto/blocto-android-sdk/actions/workflows/ci.yml/badge.svg)
![GitHub](https://img.shields.io/github/license/portto/blocto-android-sdk)

Integrate Blocto service into your dApp on Android.

Currently support

* Solana
* Ethereum
* Arbitrum
* Optimism
* BNB Chain
* Polygon
* Avalanche
* Solana
* More blockchains are coming soon

> For Flow, it's recommended to use [fcl](https://github.com/portto/fcl-android). Check the [documents](https://docs.blocto.app/blocto-sdk/android-sdk/flow) for more info.
Expand Down
9 changes: 7 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ android {
targetSdk versions.compileSdk
versionCode 1
versionName "1.0.0"
versionNameSuffix "-" + getDate()
}

def signingFilePath = "secrets/signing.properties"
Expand Down Expand Up @@ -67,6 +68,10 @@ android {
}
}

static def getDate() {
return new Date().format('yyyyMMddHHmm')
}

dependencies {
implementation project(':evm')
implementation project(':solana')
Expand All @@ -92,9 +97,9 @@ dependencies {
exclude module: 'bcprov-jdk15on'
}

implementation("com.nftco:flow-jvm-sdk:0.7.1") {
implementation("com.nftco:flow-jvm-sdk:0.7.3") {
exclude module: 'bcprov-jdk15on'
}
implementation("io.grpc:grpc-okhttp:1.47.0")
implementation("io.grpc:grpc-okhttp:1.50.2")
implementation platform("com.google.firebase:firebase-bom:29.3.1")
}
4 changes: 2 additions & 2 deletions app/src/main/java/com/portto/valuedapp/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ object Config {
const val INFURA_ID = ""

// Your Blocto App ID
const val APP_ID_MAINNET = "49618b1e-461b-4134-8f52-4307dd542a88"
const val APP_ID_TESTNET = "57f397df-263c-4e97-b61f-15b67b9ce285"
const val APP_ID_MAINNET = "0896e44c-20fd-443b-b664-d305b52fe8e8"
const val APP_ID_TESTNET = "0896e44c-20fd-443b-b664-d305b52fe8e8"

// Required by Flow
const val FLOW_APP_IDENTIFIER = "Awesome App (v0.0)"
Expand Down
Loading

0 comments on commit 26e330b

Please sign in to comment.