Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone msdk repository by github actions #33

Merged
merged 2 commits into from Nov 22, 2022
Merged
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
93 changes: 13 additions & 80 deletions .github/workflows/maxrefdes178.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,24 @@ jobs:
- name: Checkout Maxim SDK
uses: actions/checkout@v2
with:
repository: Maxim-Integrated-Software-Public/maxim-sdk-windows-actions
repository: Analog-Devices-MSDK/msdk
path: MaximSDK
submodules: recursive

- name: Checkout Maxim SDK Tools
uses: actions/checkout@v2
with:
repository: Maxim-Integrated-Software-Public/maxim-sdk-windows-actions
path: MSDKTools
lfs: 'true'

- name: Prepare Maxim Toolchain and SDK
- name: Prepare Maxim Toolchain
run: |
cd MaximSDK
cd MSDKTools
7z x Tools.7z
7z x Libraries.7z
cp -r ./Tools/GNUTools/ ../MaximSDK/Tools/
cp -r ./Tools/MinGW/ ../MaximSDK/Tools/
cd ../MaximSDK

- name: Get Version Info
run: |
Expand Down Expand Up @@ -775,79 +784,3 @@ jobs:
with:
name: maxrefdes178_firmware_v${{env.VERSION}}
path: release/**

build_android:
name: Build Android App
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
submodules: 'recursive'

- name: Get Version Info
run: |
# This block parses version.h file in source code for version info.

VERSION_MAJOR=$(awk '/VERSION_MAJOR/ {print $3}' maxrefdes178_common/maxrefdes178_version.h | tr -d '\r')
VERSION_MINOR=$(awk '/VERSION_MINOR/ {print $3}' maxrefdes178_common/maxrefdes178_version.h | tr -d '\r')
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${{github.run_number}}"
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Set Build Info
run: |
# This block generates build info header file to include from source code.

cat >maxrefdes178_common/maxrefdes178_build_info.h<<EOF
/* AUTOGENERATED, DO NOT EDIT */
#ifndef _BUILD_INFO_H_
#define _BUILD_INFO_H_
#define S_BUILD_NUMBER ${{github.run_number}}
#define S_BUILD_TYPE "${BUILD_TYPE}"
#define S_BUILD_MACHINE "$(hostname)"
#define S_BUILD_SCM_REVISION "${{github.sha}}"
#define S_BUILD_TIMESTAMP "$(date +%Y%m%d%H%M)"
#endif /* _BUILD_INFO_H_ */
EOF

- name: Pre Build FaceID Android
run: |
echo "chaquopy.license=${{ secrets.MAXREFDES178_CHAQUOPY_LICENSE }}" >> maxrefdes178-FaceId/maxrefdes178_android/local.properties

- name: Build FaceID Android Application
uses: eskatos/[email protected]
with:
build-root-directory: maxrefdes178-FaceId/maxrefdes178_android
wrapper-directory: maxrefdes178-FaceId/maxrefdes178_android
arguments: app::assembleRelease --no-daemon
gradle-version: wrapper
wrapper-cache-enabled: true
dependencies-cache-enabled: true
configuration-cache-enabled: true

- name: Sign Android Application
uses: r0adkll/sign-android-release@v1
# ID used to access action output
id: sign_app
with:
releaseDirectory: maxrefdes178-FaceId/maxrefdes178_android/app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.MAXREFDES178_SIGNING_KEY }}
alias: ${{ secrets.MAXREFDES178_KEY_ALIAS }}
keyStorePassword: ${{ secrets.MAXREFDES178_KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.MAXREFDES178_KEY_PASSWORD }}

- name: Prepare Release
run: |
mkdir release

mkdir release/FaceId
mv ${{steps.sign_app.outputs.signedReleaseFile}} release/FaceId/maxrefdes178_android_faceid_v${VERSION}.apk
# mv app/build/outputs/apk/debug/app-debug.apk release/FaceId/maxrefdes178_android_faceid_debug_v${VERSION}.apk

- uses: actions/upload-artifact@v2
if: always()
with:
name: maxrefdes178_android_v${{env.VERSION}}
path: release/**