-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (75 loc) · 2.86 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Verify Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build and Verify Application
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install tree command
run: brew install tree
- name: Setup signing certificates and keystore
# This step extracts the required signing materials from a base64 encoded zip stored in GitHub Secrets
# The zip contains:
# - .cer file: Developer certificate for signing
# - .p7b file: Profile for app provisioning
# - .p12 file: Keystore containing private key
run: |
# Decode base64 secret to zip file
echo "${{ secrets.ONIRO_APP_SIGNATURE_ZIP }}" | base64 -d > secrets.zip
# Extract files while preserving directory structure
unzip -o secrets.zip
# Cleanup temporary zip file
rm secrets.zip
# Display extracted files for verification
echo "=== Extracted Signing Materials ==="
tree .secret -L 4
- name: Modify bundleName in app.json5
run: |
echo "Modifying bundleName in app.json5 to match the one in the signature materials"
echo "this is a temporary workaround for using the same signature materials stored"
echo "in GitHub secrets for multiple apps"
sed -i '' 's/"bundleName": "[^"]*"/"bundleName": "com.example.oniromathpunching"/' ./AppScope/app.json5
- name: Set up tools and dependencies
uses: Snapp-Mobile/oh-action@main
- name: Verify Installation
run: |
echo "=== Environment Variables ==="
echo "PATH: $PATH"
echo "OHOS_BASE_SDK_HOME: $OHOS_BASE_SDK_HOME"
echo "CMD_PATH: $CMD_PATH"
echo "=== OHPM Installation ==="
which ohpm
ohpm -v
echo "=== Hvigor Installation ==="
which hvigorw
hvigorw --version
echo "=== Installation Directories ==="
echo "Command-line Tools:"
tree -L 3 $CMD_PATH
echo "OpenHarmony SDK:"
tree -L 3 $OHOS_BASE_SDK_HOME
echo "=== Node.js Version ==="
node --version
npm --version
echo "=== NPM Configuration ==="
cat $HOME/.npmrc
- name: Install OpenHarmony Dependencies
run: ohpm install --all
- name: Initialize and Build
run: |
hvigorw --version --accept-license
hvigorw clean --no-parallel --no-daemon
hvigorw assembleHap --mode module -p product=default --stacktrace --no-parallel --no-daemon
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: HAP packages
path: ./entry/build/default/outputs/default