Skip to content

Commit

Permalink
Add devfile && Dockerfile
Browse files Browse the repository at this point in the history
Change-Id: Ice53a2bd63e0b40901e83a8d1fdd8e30025dcbf2
  • Loading branch information
yangkx1024 committed Dec 9, 2023
1 parent 14048e0 commit adbe086
Show file tree
Hide file tree
Showing 12 changed files with 393 additions and 119 deletions.
64 changes: 64 additions & 0 deletions .fleet/run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"configurations": [
{
"type": "cargo",
"name": "Cargo test",
"cargoArgs": [
"test"
],
},
{
"type": "cargo",
"name": "Cargo test feature encryption",
"cargoArgs": [
"test"
],
"cargoExtraArgs": [
"--features",
"encryption"
],
},

{
"type": "command",
"name": "Build All",
"program": "./build.sh",
},
{
"type": "command",
"name": "Build Android",
"program": "./build_android.sh",
},
{
"type": "command",
"name": "Build Apple",
"program": "./build_apple.sh",
},
{
"type": "gradle",
"workingDir": "./android/",
"name": "Gradle Build",
"tasks": [
"assembleDebug"
],
},
{
"type": "gradle",
"workingDir": "./android/",
"name": "Gradle Connected Android Test",
"tasks": [
"connectedAndroidTest"
],
},
{
"type": "command",
"name": "Swift Test",
"workingDir": "./ios/MMKV/",
"program": "swift",
"args": [
"test"
],
},

]
}
3 changes: 3 additions & 0 deletions .fleet/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.formatOnSave": true
}
86 changes: 43 additions & 43 deletions .github/workflows/android-publish.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
name: Publish Android package
on:
release:
on:
release:
types: [published]

jobs:
build:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Decode Keystore
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
run: |
echo ${ENCODED_KEYSTORE} | base64 -d > ./android/app/keystore.jks
echo ${GPG_SECRET} | base64 -d | gpg --dearmor > ./android/secret.gpg
- name: Decode Keystore
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
run: |
echo ${ENCODED_KEYSTORE} | base64 -d > ./android/app/keystore.jks
echo ${GPG_SECRET} | base64 -d | gpg --dearmor > ./android/secret.gpg
- name: Android publish
env:
SIGN_KEY_STORE_PATH: keystore.jks
SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
SONATYPEUSERNAME: ${{ secrets.SONATYPEUSERNAME }}
SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PWD: ${{ secrets.GPG_PWD }}
run: |
cd ./android
echo SIGN_KEY_STORE_PATH=keystore.jks >> local.properties
echo SIGN_STORE_PASSWORD=${SIGN_STORE_PASSWORD} >> local.properties
echo SIGN_KEY_ALIAS=${SIGN_KEY_ALIAS} >> local.properties
echo SIGN_KEY_PASSWORD=${SIGN_KEY_PASSWORD} >> local.properties
echo sonatypeUsername=${SONATYPEUSERNAME} >> local.properties
echo sonatypePassword=${SONATYPEPASSWORD} >> local.properties
echo signing.keyId=${GPG_KEY_ID} >> local.properties
echo signing.password=${GPG_PWD} >> local.properties
echo signing.secretKeyRingFile=../secret.gpg >> local.properties
chmod +x gradlew
./gradlew clean
./gradlew publish
- name: Android publish
env:
SIGN_KEY_STORE_PATH: keystore.jks
SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
SONATYPEUSERNAME: ${{ secrets.SONATYPEUSERNAME }}
SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PWD: ${{ secrets.GPG_PWD }}
run: |
cd ./android
echo SIGN_KEY_STORE_PATH=keystore.jks >> local.properties
echo SIGN_STORE_PASSWORD=${SIGN_STORE_PASSWORD} >> local.properties
echo SIGN_KEY_ALIAS=${SIGN_KEY_ALIAS} >> local.properties
echo SIGN_KEY_PASSWORD=${SIGN_KEY_PASSWORD} >> local.properties
echo sonatypeUsername=${SONATYPEUSERNAME} >> local.properties
echo sonatypePassword=${SONATYPEPASSWORD} >> local.properties
echo signing.keyId=${GPG_KEY_ID} >> local.properties
echo signing.password=${GPG_PWD} >> local.properties
echo signing.secretKeyRingFile=../secret.gpg >> local.properties
chmod +x gradlew
./gradlew clean
./gradlew publish
90 changes: 47 additions & 43 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
name: Android Build Check

on:
push:
on:
push:
branches: [ "main", "develop" ]
pull_request:
pull_request:
branches: [ "main", "develop" ]

jobs:
build:
jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Decode Keystore
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
run: echo ${ENCODED_KEYSTORE} | base64 -d > ./android/app/keystore.jks

- name: Build with Gradle
env:
SIGN_KEY_STORE_PATH: keystore.jks
SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
run: |
cd ./android
echo SIGN_KEY_STORE_PATH=keystore.jks >> local.properties
echo SIGN_STORE_PASSWORD=${SIGN_STORE_PASSWORD} >> local.properties
echo SIGN_KEY_ALIAS=${SIGN_KEY_ALIAS} >> local.properties
echo SIGN_KEY_PASSWORD=${SIGN_KEY_PASSWORD} >> local.properties
chmod +x gradlew
./gradlew clean
./gradlew assembleDebug
- name: Android test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis_playstore
arch: x86_64
script: cd ./android; ./gradlew connectedAndroidTest
steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Decode Keystore
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
run: echo ${ENCODED_KEYSTORE} | base64 -d > ./android/app/keystore.jks

- name: Build with Gradle
env:
SIGN_KEY_STORE_PATH: keystore.jks
SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
SIGN_KEY_PASSWORD: ${{ secrets.SIGN_KEY_PASSWORD }}
SONATYPEUSERNAME: ${{ secrets.SONATYPEUSERNAME }}
SONATYPEPASSWORD: ${{ secrets.SONATYPEPASSWORD }}
run: |
cd ./android
echo SIGN_KEY_STORE_PATH=keystore.jks >> local.properties
echo SIGN_STORE_PASSWORD=${SIGN_STORE_PASSWORD} >> local.properties
echo SIGN_KEY_ALIAS=${SIGN_KEY_ALIAS} >> local.properties
echo SIGN_KEY_PASSWORD=${SIGN_KEY_PASSWORD} >> local.properties
echo sonatypeUsername=${SONATYPEUSERNAME} >> local.properties
echo sonatypePassword=${SONATYPEPASSWORD} >> local.properties
chmod +x gradlew
./gradlew clean
./gradlew assembleDebug
- name: Android test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis_playstore
arch: x86_64
script: cd ./android; ./gradlew connectedAndroidTest
14 changes: 7 additions & 7 deletions .github/workflows/rust-publish.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Publish Rust package
on:
release:
on:
release:
types: [published]

env:
env:
CARGO_TERM_COLOR: always

jobs:
build:
jobs:
build:
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@v4
- name: Cargo publish
run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
env:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
32 changes: 16 additions & 16 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
name: Cargo Test

on:
push:
on:
push:
branches: [ "main", "develop" ]
pull_request:
pull_request:
branches: [ "main", "develop" ]

env:
env:
CARGO_TERM_COLOR: always

jobs:
build:
jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Build default
run: cargo build --verbose
- name: Build feature encryption
run: cargo build --features encryption --verbose
- name: Run default tests
run: cargo test --verbose
- name: Run feature encryption tests
run: cargo test --features encryption --verbose
steps:
- uses: actions/checkout@v4
- name: Build default
run: cargo build --verbose
- name: Build feature encryption
run: cargo build --features encryption --verbose
- name: Run default tests
run: cargo test --verbose
- name: Run feature encryption tests
run: cargo test --features encryption --verbose
12 changes: 6 additions & 6 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Swift Test

on:
push:
on:
push:
branches: [ "main", "develop" ]
pull_request:
pull_request:
branches: [ "main", "develop" ]

jobs:
build:
jobs:
build:

runs-on: macos-latest

steps:
steps:
- uses: swift-actions/setup-swift@v1
- uses: actions/checkout@v4
- name: Build
Expand Down
Loading

0 comments on commit adbe086

Please sign in to comment.