Skip to content

Commit 342051a

Browse files
Copilot0xrinegade
andcommitted
Implement comprehensive build system for all platforms with CI/CD support
Co-authored-by: 0xrinegade <[email protected]>
1 parent 0c4a8be commit 342051a

File tree

62 files changed

+1943
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1943
-1
lines changed
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
name: Build All Platforms
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
release:
9+
types: [ published ]
10+
11+
jobs:
12+
build-web:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version-file: '.nvmrc'
22+
cache: 'yarn'
23+
24+
- name: Install dependencies
25+
run: yarn install --frozen-lockfile
26+
27+
- name: Build web application
28+
run: ./scripts/build-web.sh
29+
30+
- name: Upload web artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: web-build
34+
path: deploy_*/
35+
retention-days: 30
36+
37+
build-extensions:
38+
runs-on: ubuntu-latest
39+
needs: build-web
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version-file: '.nvmrc'
48+
cache: 'yarn'
49+
50+
- name: Install dependencies
51+
run: yarn install --frozen-lockfile
52+
53+
- name: Build browser extensions
54+
run: ./scripts/build-extensions.sh
55+
56+
- name: Upload extension artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: browser-extensions
60+
path: |
61+
extension/*.zip
62+
extension/extension-build-info.txt
63+
retention-days: 30
64+
65+
build-android:
66+
runs-on: ubuntu-latest
67+
needs: build-web
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
72+
- name: Setup Node.js
73+
uses: actions/setup-node@v4
74+
with:
75+
node-version-file: '.nvmrc'
76+
cache: 'yarn'
77+
78+
- name: Setup Java
79+
uses: actions/setup-java@v4
80+
with:
81+
distribution: 'temurin'
82+
java-version: '17'
83+
84+
- name: Install dependencies
85+
run: yarn install --frozen-lockfile
86+
87+
- name: Build mobile applications
88+
run: ./scripts/build-mobile.sh
89+
90+
- name: Upload Android artifacts
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: android-builds
94+
path: |
95+
android/app/build/outputs/apk/**/*.apk
96+
android/app/build/outputs/bundle/**/*.aab
97+
retention-days: 30
98+
99+
build-all-platforms:
100+
runs-on: ubuntu-latest
101+
if: github.event_name == 'release'
102+
steps:
103+
- name: Checkout code
104+
uses: actions/checkout@v4
105+
106+
- name: Setup Node.js
107+
uses: actions/setup-node@v4
108+
with:
109+
node-version-file: '.nvmrc'
110+
cache: 'yarn'
111+
112+
- name: Setup Java
113+
uses: actions/setup-java@v4
114+
with:
115+
distribution: 'temurin'
116+
java-version: '17'
117+
118+
- name: Install dependencies
119+
run: yarn install --frozen-lockfile
120+
121+
- name: Build all platforms
122+
run: ./scripts/build-all-platforms.sh
123+
124+
- name: Upload complete build artifacts
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: complete-build-${{ github.sha }}
128+
path: |
129+
artifacts_*/
130+
svmseek-wallet-*.tar.gz
131+
retention-days: 90
132+
133+
- name: Upload to release
134+
if: github.event_name == 'release'
135+
uses: actions/upload-release-asset@v1
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
with:
139+
upload_url: ${{ github.event.release.upload_url }}
140+
asset_path: ./svmseek-wallet-*.tar.gz
141+
asset_name: svmseek-wallet-all-platforms.tar.gz
142+
asset_content_type: application/gzip
143+
144+
test:
145+
runs-on: ubuntu-latest
146+
steps:
147+
- name: Checkout code
148+
uses: actions/checkout@v4
149+
150+
- name: Setup Node.js
151+
uses: actions/setup-node@v4
152+
with:
153+
node-version-file: '.nvmrc'
154+
cache: 'yarn'
155+
156+
- name: Install dependencies
157+
run: yarn install --frozen-lockfile
158+
159+
- name: Run tests
160+
run: yarn test --watchAll=false --coverage
161+
162+
- name: Install Playwright
163+
run: yarn playwright:install
164+
165+
- name: Run E2E tests
166+
run: yarn test:e2e
167+
168+
- name: Upload test results
169+
uses: actions/upload-artifact@v4
170+
if: always()
171+
with:
172+
name: test-results
173+
path: |
174+
coverage/
175+
playwright-report/
176+
retention-days: 7

.gitignore

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ yarn-error.log*
3232
.eslintcache
3333

3434
# Capacitor mobile app directories
35-
android/
3635
ios/
3736
.capacitor/
37+
38+
# Build artifacts and deployment packages
39+
artifacts_*/
40+
deploy_*/
41+
svmseek-wallet-*.tar.gz
42+
svmseek-wallet-web-*.tar.gz
43+
44+
# Keep android directory but ignore build outputs
45+
android/app/build/
46+
android/app/.cxx/
47+
android/build/
48+
android/.gradle/
49+
android/local.properties

android/.gitignore

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore
2+
3+
# Built application files
4+
*.apk
5+
*.aar
6+
*.ap_
7+
*.aab
8+
9+
# Files for the ART/Dalvik VM
10+
*.dex
11+
12+
# Java class files
13+
*.class
14+
15+
# Generated files
16+
bin/
17+
gen/
18+
out/
19+
# Uncomment the following line in case you need and you don't have the release build type files in your app
20+
# release/
21+
22+
# Gradle files
23+
.gradle/
24+
build/
25+
26+
# Local configuration file (sdk path, etc)
27+
local.properties
28+
29+
# Proguard folder generated by Eclipse
30+
proguard/
31+
32+
# Log Files
33+
*.log
34+
35+
# Android Studio Navigation editor temp files
36+
.navigation/
37+
38+
# Android Studio captures folder
39+
captures/
40+
41+
# IntelliJ
42+
*.iml
43+
.idea/workspace.xml
44+
.idea/tasks.xml
45+
.idea/gradle.xml
46+
.idea/assetWizardSettings.xml
47+
.idea/dictionaries
48+
.idea/libraries
49+
# Android Studio 3 in .gitignore file.
50+
.idea/caches
51+
.idea/modules.xml
52+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
53+
.idea/navEditor.xml
54+
55+
# Keystore files
56+
# Uncomment the following lines if you do not want to check your keystore files in.
57+
#*.jks
58+
#*.keystore
59+
60+
# External native build folder generated in Android Studio 2.2 and later
61+
.externalNativeBuild
62+
.cxx/
63+
64+
# Google Services (e.g. APIs or Firebase)
65+
# google-services.json
66+
67+
# Freeline
68+
freeline.py
69+
freeline/
70+
freeline_project_description.json
71+
72+
# fastlane
73+
fastlane/report.xml
74+
fastlane/Preview.html
75+
fastlane/screenshots
76+
fastlane/test_output
77+
fastlane/readme.md
78+
79+
# Version control
80+
vcs.xml
81+
82+
# lint
83+
lint/intermediates/
84+
lint/generated/
85+
lint/outputs/
86+
lint/tmp/
87+
# lint/reports/
88+
89+
# Android Profiling
90+
*.hprof
91+
92+
# Cordova plugins for Capacitor
93+
capacitor-cordova-android-plugins
94+
95+
# Copied web assets
96+
app/src/main/assets/public
97+
98+
# Generated Config files
99+
app/src/main/assets/capacitor.config.json
100+
app/src/main/assets/capacitor.plugins.json
101+
app/src/main/res/xml/config.xml

android/app/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/build/*
2+
!/build/.npmkeep

android/app/build.gradle

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
namespace "com.svmseek.wallet"
5+
compileSdk rootProject.ext.compileSdkVersion
6+
defaultConfig {
7+
applicationId "com.svmseek.wallet"
8+
minSdkVersion rootProject.ext.minSdkVersion
9+
targetSdkVersion rootProject.ext.targetSdkVersion
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13+
aaptOptions {
14+
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
15+
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
16+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
17+
}
18+
}
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
}
26+
27+
repositories {
28+
flatDir{
29+
dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
30+
}
31+
}
32+
33+
dependencies {
34+
implementation fileTree(include: ['*.jar'], dir: 'libs')
35+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
36+
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
37+
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
38+
implementation project(':capacitor-android')
39+
testImplementation "junit:junit:$junitVersion"
40+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
41+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
42+
implementation project(':capacitor-cordova-android-plugins')
43+
}
44+
45+
apply from: 'capacitor.build.gradle'
46+
47+
try {
48+
def servicesJSON = file('google-services.json')
49+
if (servicesJSON.text) {
50+
apply plugin: 'com.google.gms.google-services'
51+
}
52+
} catch(Exception e) {
53+
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
54+
}

android/app/capacitor.build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN
2+
3+
android {
4+
compileOptions {
5+
sourceCompatibility JavaVersion.VERSION_17
6+
targetCompatibility JavaVersion.VERSION_17
7+
}
8+
}
9+
10+
apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle"
11+
dependencies {
12+
13+
14+
}
15+
16+
17+
if (hasProperty('postBuildExtras')) {
18+
postBuildExtras()
19+
}

android/app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

0 commit comments

Comments
 (0)