Skip to content

Commit 69af863

Browse files
committed
Add automated build and release script
1 parent 091a530 commit 69af863

File tree

2 files changed

+95
-72
lines changed

2 files changed

+95
-72
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Sample Apps
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
- name: Decode Keystore
16+
env:
17+
LOCAL_KEYSTORE: ${{ secrets.LOCAL_KEYSTORE }}
18+
run: echo $LOCAL_KEYSTORE | base64 -di > my-release-key.keystore
19+
- name: Set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: '17'
23+
distribution: 'temurin' # Or 'zulu', 'microsoft', 'corretto', etc.
24+
cache: 'gradle' # Or 'gradle', 'sbt' depending on your build tool
25+
- name: Set up Node 20
26+
uses: actions/setup-node@v4
27+
with:
28+
cache-dependency-path: React/ParcelMDClient/package-lock.json
29+
node-version: 20
30+
cache: 'npm'
31+
- name: NPM install
32+
run: cd React/ParcelMDClient && npm install
33+
- name: Build React Sample App
34+
run: |
35+
cd React/ParcelMDClient/android
36+
chmod +x gradlew && ./gradlew assembleRelease\
37+
- name: Copy React Sample App
38+
run: |
39+
mkdir $GITHUB_WORKSPACE/ReleaseBinaries
40+
cp $GITHUB_WORKSPACE/React/ParcelMDClient/android/app/build/outputs/apk/release/app-release.apk $GITHUB_WORKSPACE/ReleaseBinaries/ReactParcelMDClient.apk
41+
- name: Upload React ParcelMDClientSampleApp
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: React ParcelMDClientSampleApp Binaries
45+
path: ReleaseBinaries/ReactParcelMDClient.apk
46+
if-no-files-found: error
47+
- name: Build ParcelMDClientSampleApp
48+
run: |
49+
cd Java/ParcelMDClientSampleApp
50+
chmod +x gradlew && ./gradlew assembleRelease
51+
- name: Sign ParcelMDClientSampleApp
52+
run: |
53+
$ANDROID_HOME/build-tools/36.0.0/apksigner sign --ks $GITHUB_WORKSPACE/my-release-key.keystore --ks-pass pass:${{secrets.LOCAL_KEYSTORE_PASSWORD}} --out $GITHUB_WORKSPACE/ReleaseBinaries/ParcelMDClient.apk $GITHUB_WORKSPACE/Java/ParcelMDClientSampleApp/app/build/outputs/apk/release/DimensioningClient.apk
54+
- name: Upload ParcelMDClientSampleApp
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: ParcelMDClientSampleApp Binaries
58+
path: ReleaseBinaries/ParcelMDClient.apk
59+
if-no-files-found: error
60+
- name: Build MDIntegrationApp
61+
run: |
62+
cd Java/MDIntegrationApp
63+
chmod +x gradlew && ./gradlew assembleRelease
64+
- name: Sign MDIntegrationApp
65+
run: |
66+
$ANDROID_HOME/build-tools/36.0.0/apksigner sign --ks $GITHUB_WORKSPACE/my-release-key.keystore --ks-pass pass:${{secrets.LOCAL_KEYSTORE_PASSWORD}} --out $GITHUB_WORKSPACE/ReleaseBinaries/MDIntegrationApp.apk $GITHUB_WORKSPACE/Java/MDIntegrationApp/app/build/outputs/apk/release/app-release-unsigned.apk
67+
- name: Upload MDIntegrationApp
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: MDIntegrationApp Binaries
71+
path: ReleaseBinaries/MDIntegrationApp.apk
72+
if-no-files-found: error
73+
release:
74+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
75+
runs-on: ubuntu-latest
76+
needs: build
77+
steps:
78+
- name: Download All Artifacts
79+
uses: actions/download-artifact@v5
80+
with:
81+
path: binaries
82+
merge-multiple: true
83+
- name: Zip binaries
84+
run: zip -r binaries.zip binaries
85+
- name: Create release
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
tag: ${{ github.ref_name }}
89+
run: |
90+
gh release create "$GITHUB_REF_NAME" binaries.zip \
91+
--repo="$GITHUB_REPOSITORY" \
92+
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
93+
--generate-notes
94+
95+

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)