Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
pokeum committed Feb 4, 2024
0 parents commit 2f0d46d
Show file tree
Hide file tree
Showing 112 changed files with 42,290 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/automate-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Automate Deployment

on:
workflow_dispatch: # Manual Events
# pull_request:
# types: [closed]
# branches:
# - main

jobs:
automate-deployment:
runs-on: ubuntu-latest

env:
JSONVIEWER_JKS_BASE64: ${{ secrets.JSONVIEWER_JKS_BASE64 }}

JSONVIEWER_KEYSTORE_ALIAS: ${{ secrets.JSONVIEWER_KEYSTORE_ALIAS }}
JSONVIEWER_KEY_PASSWORD: ${{ secrets.JSONVIEWER_KEY_PASSWORD }}
JSONVIEWER_STORE_PASSWORD: ${{ secrets.JSONVIEWER_STORE_PASSWORD }}

GOOGLE_CLOUD_JSON_KEY: ${{ secrets.GOOGLE_CLOUD_JSON_KEY }}
JSON_KEY_PATH: ${{ 'google-cloud-json-key.json' }} # fastlane/Appfile

BUILD_CONFIG_FILE_PATH: ${{ 'app/build/generated/source/buildConfig/release/kr/pokeum/app/BuildConfig.java' }}

SLACK_CHANNEL: ${{ 'jsonviewer-release' }}

steps:
- name: clone repository
uses: actions/checkout@v3

- name: "[Signing Release APK 🔑] set system environment variables"
run: |
export JSONVIEWER_KEYSTORE_ALIAS="$JSONVIEWER_KEYSTORE_ALIAS"
export JSONVIEWER_KEY_PASSWORD="$JSONVIEWER_KEY_PASSWORD"
export JSONVIEWER_STORE_PASSWORD="$JSONVIEWER_STORE_PASSWORD"
- name: "[Signing Release APK 🔑] upload jks file"
run: |
mkdir $HOME/keystore
cd $HOME/keystore
echo "$JSONVIEWER_JKS_BASE64" | base64 --decode > jsonviewer_keystore.jks
- name: "[Fastlane] set up ruby (version 2.7.5)"
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.5
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: "[Fastlane] install bundler"
run: gem install bundler && bundle install

- name: "[Fastlane] upload json key file"
run: echo "$GOOGLE_CLOUD_JSON_KEY" > "$JSON_KEY_PATH"

- name: "[Fastlane] fetch your app metadata"
run: bundle exec fastlane supply init

- name: "[Fastlane] run test"
run: bundle exec fastlane test

- name: "[Fastlane] publish app to google play store"
#run: bundle exec fastlane deploy
run: bundle exec fastlane deploy_aab

- name: "[Fastlane][Post 🧹] upload json key file"
run: rm "$JSON_KEY_PATH"

- name: "[Get App Version] get and save version"
run: cat "$BUILD_CONFIG_FILE_PATH" | grep VERSION_NAME | sed 's/[^[:digit:].]//g' > VERSION
if: always()

- name: "[Get App Version] read version file"
id: read_version
run: echo "::set-output name=version::$(cat VERSION)"
if: always()

- name: "[Get Version] commit version file"
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
if: success()

- name: "[Slack] send slack notification (success 🚀)"
uses: Brymastr/slack-action@v1
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel-id: '${{ env.SLACK_CHANNEL }}'
template: './slack/success.json'
version: ${{ steps.read_version.outputs.version }}
if: success()

- name: "[Slack] send slack notification (fail 😢)"
uses: Brymastr/slack-action@v1
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel-id: '${{ env.SLACK_CHANNEL }}'
template: './slack/fail.json'
version: ${{ steps.read_version.outputs.version }}
if: failure()
33 changes: 33 additions & 0 deletions .github/workflows/get-app-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Get App Version

on:
workflow_dispatch: # Manual Events

jobs:
get-app-version:
runs-on: ubuntu-latest

env:
BUILD_CONFIG_FILE_PATH: ${{ 'app/build/generated/source/buildConfig/debug/kr/pokeum/app/BuildConfig.java' }}

steps:
- name: clone repo
uses: actions/checkout@v3

- name: setup java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
cache: 'gradle'

- name: build jsonviewer app
run: ./gradlew app:assembleDebug

- name: get and save version
run: cat "$BUILD_CONFIG_FILE_PATH" | grep VERSION_NAME | sed 's/[^[:digit:].]//g' > VERSION

- name: commit version file
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
36 changes: 36 additions & 0 deletions .github/workflows/signing-key-verification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Signing Key Verification

on:
workflow_dispatch: # Manual Events

jobs:
signing-key-verification:
runs-on: ubuntu-latest

env:
JSONVIEWER_JKS_BASE64: ${{ secrets.JSONVIEWER_JKS_BASE64 }}

JSONVIEWER_KEYSTORE_ALIAS: ${{ secrets.JSONVIEWER_KEYSTORE_ALIAS }}
JSONVIEWER_KEY_PASSWORD: ${{ secrets.JSONVIEWER_KEY_PASSWORD }}
JSONVIEWER_STORE_PASSWORD: ${{ secrets.JSONVIEWER_STORE_PASSWORD }}

steps:
- name: clone repository
uses: actions/checkout@v3

- name: "[Signing Release APK 🔑] set system environment variables"
run: |
export JSONVIEWER_KEYSTORE_ALIAS="$JSONVIEWER_KEYSTORE_ALIAS"
export JSONVIEWER_KEY_PASSWORD="$JSONVIEWER_KEY_PASSWORD"
export JSONVIEWER_STORE_PASSWORD="$JSONVIEWER_STORE_PASSWORD"
- name: "[Signing Release APK 🔑] upload jks file"
run: |
mkdir $HOME/keystore
cd $HOME/keystore
echo "$JSONVIEWER_JKS_BASE64" | base64 --decode > jsonviewer_keystore.jks
- name: Signing Key Verification
run: |
./gradlew clean
./gradlew app:assembleRelease
31 changes: 31 additions & 0 deletions .github/workflows/test-connection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test Connection

on:
workflow_dispatch: # Manual Events

jobs:
test-connection:
runs-on: ubuntu-latest

env:
GOOGLE_CLOUD_JSON_KEY: ${{ secrets.GOOGLE_CLOUD_JSON_KEY }}
JSON_KEY_PATH: ${{ 'google-cloud-json-key.json' }}

steps:
- name: clone repository
uses: actions/checkout@v3

- name: "[Fastlane] set up ruby (version 2.7.5)"
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.5
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: "[Fastlane] install bundler"
run: gem install bundler && bundle install

- name: "[Fastlane] upload json key file"
run: echo "$GOOGLE_CLOUD_JSON_KEY" > "$JSON_KEY_PATH"

- name: "[Fastlane] test the connection to google play store"
run: bundle exec fastlane run validate_play_store_json_key json_key:"$JSON_KEY_PATH"
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
.idea
/local.properties
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties

.project
.settings/

/app/release/
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Android JSON Viewer

[![Generic badge](https://img.shields.io/badge/jitpack-v0.0.0-darkyellow?logo=jitpack&logoColor=white.svg)]()
[![Generic badge](https://img.shields.io/badge/Google_Play-jsonviewer-lightblue?logo=googlePlay&logoColor=white)](https://play.google.com/store/apps/details?id=kr.pokeum.jsonviewer.app)

---

<div align="center">

### JSON Viewer and Beautifier

A lightweight package that will read JSON data, expand and collapse JSON view accordingly.

</div>

---

**Easiest way to format Json String**

```xml
<kr.pokeum.jsonviewer_xml.JsonRecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:text="{PUT_YOUR_JSON_STRING}" />
```

## Table of Contents
- [Installation](#Installation)
- [Usage](#Usage)
- [Basic](#Basic)
- [Advance](#Advance)


## <a id="Installation"> Installation

## <a id="Usage"> Usage

- ## <a id="Basic"> Basic

- ## <a id="Advance"> Advance
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.1
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
78 changes: 78 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.google.gms.google-services'
id 'com.google.firebase.appdistribution'
}

def majorNumber = 1
def minorNumber = 0
def patchNumber = 1

def versionNameApp = "$majorNumber.$minorNumber.$patchNumber"
def versionCodeBase = majorNumber * 100000 + minorNumber * 1000 + patchNumber * 10
def versionCodeApp = versionCodeBase + 1

android {
compileSdkVersion defaultCompileSdkVersion
buildToolsVersion defaultBuildToolsVersion

defaultConfig {
applicationId "kr.pokeum.jsonviewer.app"
minSdkVersion defaultMinSdkVersion
targetSdkVersion defaultTargetSdkVersion
versionCode versionCodeApp
versionName versionNameApp

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
release {
keyAlias System.getenv("JSONVIEWER_KEYSTORE_ALIAS")
keyPassword System.getenv("JSONVIEWER_KEY_PASSWORD")
storeFile file(System.getenv("HOME") + "/keystore/jsonviewer_keystore.jks")
storePassword System.getenv("JSONVIEWER_STORE_PASSWORD")
}
}
buildTypes {
release {
debuggable false
minifyEnabled true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility javaCompileVersion
targetCompatibility javaCompileVersion
}
kotlinOptions {
jvmTarget = jvmTarget
}
buildFeatures {
viewBinding true
}
}

dependencies {

implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.github.pokeum:jsonviewer-xml:0.0.0'

implementation stdlib.kotlin
implementation androidx.core
implementation androidx.appcompat
implementation androidx.constraintLayout
implementation material.material
implementation coroutine.core
implementation coroutine.android
implementation network.okhttp

implementation platform(firebase.bom)

testImplementation test.junit

androidTestImplementation androidTest.junit
androidTestImplementation androidTest.espressoCore
}
29 changes: 29 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "1019350039203",
"project_id": "jsonviewer-86f73",
"storage_bucket": "jsonviewer-86f73.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:1019350039203:android:9cd8b741a970ae86e2dd16",
"android_client_info": {
"package_name": "kr.pokeum.jsonviewer.app"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDicc_OVvidEUGxm0bYZPds0SJ8jZMscVU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
Loading

0 comments on commit 2f0d46d

Please sign in to comment.