Skip to content

Commit 58f5807

Browse files
creating ci
1 parent 901c0c3 commit 58f5807

File tree

8 files changed

+673
-2
lines changed

8 files changed

+673
-2
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Template configuration for Convertigo project CI build on GitHub Actions
2+
# Please consult the GitHub documentation for details about settings
3+
# https://docs.github.com/en/actions
4+
#
5+
# This sample assumes you have declared the following Encrypted Secrets
6+
# https://docs.github.com/en/actions/reference/encrypted-secrets
7+
#
8+
# C8O_SERVER: Convertigo server endpoint, where the built mobile application will connect
9+
# and the backend project will be deployed, like https://<myhost>/convertigo
10+
# C8O_USER: Convertigo server admin or a user with role PROJECTS_CONFIG, used for the deploiment
11+
# C8O_PASSWORD: Convertigo server password for the C8O_USER
12+
#
13+
# C8O_SERVER_PROD: override C8O_SERVER for tags
14+
# C8O_USER_PROD: override C8O_USER for tags
15+
# C8O_PASSWORD_PROD: override C8O_PASSWORD for tags
16+
#
17+
# Discover all tasks and -Pconvertigo options in your project build.gradle file.
18+
19+
name: Convertigo CI
20+
21+
on:
22+
push:
23+
tags:
24+
- '**'
25+
26+
jobs:
27+
build_and_deploy:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout code
31+
uses: actions/checkout@v4
32+
with:
33+
ssh-key: ${{ secrets.SSH_KEY }}
34+
35+
- name: Setup Java
36+
uses: actions/setup-java@v4
37+
with:
38+
java-version: '17'
39+
distribution: 'temurin'
40+
41+
- name: Cache Gradle Dependencies
42+
uses: actions/cache@v4
43+
with:
44+
path: |
45+
~/.gradle/caches
46+
~/.gradle/wrapper
47+
key: ${{ runner.os }}-gradle-caches-v1-${{ hashFiles('**/*.gradle', '**/gradle/wrapper/gradle-wrapper.properties') }}
48+
restore-keys: ${{ runner.os }}-gradle-caches-v1-
49+
50+
- name: Cache Node Modules
51+
uses: actions/cache@v4
52+
with:
53+
path: |
54+
${{ github.workspace }}/_private/ionic/node_modules
55+
${{ github.workspace }}/_private/ionic/.angular
56+
/home/runner/convertigo/nodes
57+
key: ${{ runner.os }}-build-node-${{ hashFiles('**/package.json', '**/_private/ionic/version.json') }}
58+
restore-keys: ${{ runner.os }}-build-node-
59+
60+
- name: Convertigo generate application code
61+
run: |
62+
echo "Generate Mobile Builder App" && \
63+
sh gradlew --stacktrace --info generateMobileBuilder export -x compileMobileBuilder
64+
65+
- name: Build and deploy based on branch or tag
66+
run: |
67+
echo "Creating .car";
68+
sh gradlew --stacktrace --info car
69+
70+
- name: Save application project
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: project
74+
path: build/*.car
75+
76+
release:
77+
if: github.ref_type == 'tag'
78+
needs: build_and_deploy
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Download CAR File
82+
uses: actions/download-artifact@v4
83+
with:
84+
name: project
85+
86+
- name: Deploy to GitHub Release
87+
uses: softprops/action-gh-release@v2
88+
with:
89+
files: '*.car'
90+
tag_name: ${{ github.ref_name }}
91+
draft: false
92+
prerelease: false
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.gradle

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
buildscript {
2+
repositories {
3+
mavenLocal()
4+
maven {
5+
url "https://m2.convertigo.com"
6+
}
7+
mavenCentral()
8+
}
9+
dependencies {
10+
classpath 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:[5.4,)'
11+
classpath 'com.convertigo:gradle-plugin:8.4.0-SNAPSHOT'
12+
}
13+
}
14+
15+
apply plugin: 'convertigo'
16+
17+
/** Convertigo Gradle Plugin DSL **/
18+
19+
//// determines if the project needs to perform a mobile build before 'deploy' or 'car' tasks
20+
//// can also be configured with a -Pconvertigo.performsMobileBuild as Gradle parameter
21+
def performsMobileBuild = file('_c8oProject/mobilePages').exists() && !'false'.equals(project.properties['convertigo.performsMobileBuild'])
22+
23+
//// the 'load' task loads and migrates the project to the current plugin version
24+
load {
25+
//// change the 'version' property of the project at loading
26+
//// can also be configured with a -Pconvertigo.load.projectVersion as Gradle parameter
27+
// projectVersion '1.0.0-release'
28+
29+
//// change the 'Convertigo server endpoint' property of the project's mobile application at loading
30+
//// can also be configured with a -Pconvertigo.load.mobileApplicationEndpoint as Gradle parameter
31+
// mobileApplicationEndpoint 'https://myserver.com/convertigo'
32+
33+
//// specify a folder where to auto-import git references
34+
//// can also be configured with a -Pconvertigo.load.gitContainer as Gradle parameter
35+
// gitContainer '..'
36+
37+
doLast {
38+
//// any property of the project can be changed here
39+
// convertigoProject.comment += ' edited by gradle'
40+
}
41+
}
42+
43+
//// the 'export' task depends on 'load' and saves the project at the current plugin version
44+
export {
45+
//// mobile application can be built before the 'export', then 'car' and 'deploy' can use build result
46+
if (performsMobileBuild) {
47+
dependsOn compileMobileBuilder
48+
}
49+
}
50+
51+
//// the 'generateMobileBuilder' task depends on 'load' and generates sources of the Ionic application into _private/ionic
52+
generateMobileBuilder {
53+
//// configure the generation mode, can be can be production (default) or debugplus, debug, fast
54+
//// if omitted, compileMobileBuilder.mode is used
55+
//// can also be configured with a -Pconvertigo.generateMobileBuilder.mode as Gradle parameter
56+
// mode 'production'
57+
}
58+
59+
//// the 'compileMobileBuilder' task depends on 'generateMobileBuilder' and compiles the Ionic application with NPM into DisplayObject/mobile
60+
compileMobileBuilder {
61+
//// configure the generation mode, can be can be production (default) or debug
62+
//// if omitted, generateMobileBuilder.mode is used
63+
//// can also be configured with a -Pconvertigo.compileMobileBuilder.mode as Gradle parameter
64+
// mode 'production'
65+
}
66+
67+
//// the 'car' task allows to build a <projectName>.car inside the <projectdir>/build folder
68+
car {
69+
//// configure the destination of the <projectName>.car file (default 'build' folder)
70+
//// can also be configured with a -Pconvertigo.car.destinationDir as Gradle parameter
71+
// destinationDir 'build'
72+
73+
//// include TestCases (default true)
74+
//// can also be configured with a -Pconvertigo.car.includeTestCases as Gradle parameter
75+
// includeTestCases true
76+
77+
//// include Stubs (default true)
78+
//// can also be configured with a -Pconvertigo.car.includeStubs as Gradle parameter
79+
// includeStubs true
80+
81+
//// include built MobileApp (default true)
82+
//// can also be configured with a -Pconvertigo.car.includeMobileApp as Gradle parameter
83+
// includeMobileApp true
84+
85+
//// include built MobileApp assets (default true)
86+
//// can also be configured with a -Pconvertigo.car.includeMobileAppAssets as Gradle parameter
87+
// includeMobileAppAssets true
88+
89+
//// include mobile dataset (default true)
90+
//// can also be configured with a -Pconvertigo.car.includeMobileDataset as Gradle parameter
91+
// includeMobileDataset true
92+
93+
//// include mobile platform assets (default true)
94+
//// can also be configured with a -Pconvertigo.car.includeMobilePlatformsAssets as Gradle parameter
95+
// includeMobilePlatformsAssets true
96+
97+
doLast {
98+
println "Saved Convertigo archive: $destinationFile"
99+
}
100+
}
101+
102+
//// the 'deploy' task depends on 'car' and allows to push the project to a Convertigo server
103+
//// the task is auto skipped if properties are empties, following tasks can check deploy.state.didWork
104+
deploy {
105+
//// deploy the current project to <server> using user/password credentials
106+
//// can also be configured with a -Pconvertigo.deploy.server as Gradle parameter
107+
//// Note: the task is skipped if the property doesn't start with http
108+
// server 'https://myserver.com/convertigo'
109+
110+
//// user used by the deploy action, default is 'admin'
111+
//// can also be configured with a -Pconvertigo.deploy.user as Gradle parameter
112+
//// Note: the task is skipped if the property is empty
113+
// user 'admin'
114+
115+
//// password used by the deploy action, default is 'admin'
116+
//// can also be configured with a -Pconvertigo.deploy.password as Gradle parameter
117+
//// Note: the task is skipped if the property is empty
118+
// user 'password'
119+
120+
//// deploy over an https <server> without checking certificates, default is false
121+
//// can also be configured with a -Pconvertigo.deploy.trustAllCertificates as Gradle parameter
122+
// trustAllCertificates false
123+
124+
//// assemble XSL files on deploy, default is false
125+
//// can also be configured with a -Pconvertigo.deploy.assembleXsl as Gradle parameter
126+
// assembleXsl false
127+
128+
//// retry <retry> times in case of deploy failure, default is 5
129+
//// can also be configured with a -Pconvertigo.deploy.retry as Gradle parameter
130+
// retry 5
131+
}
132+
133+
//// the 'remoteBuild' task depends on 'load' and it's just a configurator for 'launchRemoteBuild' and 'downloadRemoteBuild'
134+
remoteBuild {
135+
if (performsMobileBuild) {
136+
dependsOn compileMobileBuilder
137+
}
138+
139+
//// set an array of platforms (Convertigo Platforms object) names to build, empty means all declared platforms
140+
//// can also be configured with a -Pconvertigo.remoteBuild.platforms as Gradle parameter (names separated by comma)
141+
// platforms = []
142+
143+
//// set authenticationToken from your phonegapbuild account, default use Convertigo one
144+
//// can also be configured with a -Pconvertigo.remoteBuild.authenticationToken
145+
// authenticationToken ''
146+
147+
//// set the platform used to build application, default is https://build.convertigo.net
148+
//// can also be configured with a -Pconvertigo.remoteBuild.mobileBuilderPlatformURL
149+
// mobileBuilderPlatformURL ''
150+
151+
//// set the iOS certificate title declared on your phonegapbuild account, default use Convertigo one
152+
//// can also be configured with a -Pconvertigo.remoteBuild.iosCertificateTitle
153+
// iosCertificateTitle ''
154+
155+
//// set the iOS certificate password declared on your phonegapbuild account, default use Convertigo one
156+
//// can also be configured with a -Pconvertigo.remoteBuild.iosCertificatePassword
157+
// iosCertificatePassword ''
158+
159+
//// set the Android certificate title declared on your phonegapbuild account, default use Convertigo one
160+
//// can also be configured with a -Pconvertigo.remoteBuild.androidCertificateTitle
161+
// androidCertificateTitle ''
162+
163+
//// set the Android certificate password declared on your phonegapbuild account, default use Convertigo one
164+
//// can also be configured with a -Pconvertigo.remoteBuild.androidCertificatePassword
165+
// androidCertificatePassword ''
166+
167+
//// set the Android certificate keystore password declared on your phonegapbuild account, default use Convertigo one
168+
//// can also be configured with a -Pconvertigo.remoteBuild.androidCertificateKeystorePassword
169+
// androidCertificateKeystorePassword ''
170+
}
171+
172+
//// the 'localBuild' task depends on 'load' and allows to build mobile native package locally
173+
localBuild {
174+
if (performsMobileBuild) {
175+
dependsOn compileMobileBuilder
176+
}
177+
178+
//// set an array of platforms (Convertigo Platforms object) names to build, empty means all declared platforms
179+
//// can also be configured with a -Pconvertigo.localBuild.platforms as Gradle parameter (names separated by comma)
180+
// platforms = []
181+
182+
//// build mode of the native package, can be 'release' or 'debug' (default)
183+
//// can also be configured with a -Pconvertigo.localBuild.mode as Gradle parameter
184+
//// the Android 'debug' mode doesn't need signing configuration
185+
// mode = 'debug'
186+
187+
//// define where are moved mobile package when the build success
188+
//// can also be configured with a -Pconvertigo.localBuild.packageDestinationDir as Gradle parameter
189+
// packageDestinationDir = file('build/localDir')
190+
191+
//// define the IOS Provisioning Profile file used to sign the IPA package
192+
//// can also be configured with a -Pconvertigo.localBuild.iosProvisioningProfile as Gradle parameter
193+
// iosProvisioningProfile = file('ios.mobileprovision')
194+
195+
//// define the IOS Sign Identity used to sign the IPA package
196+
//// can also be configured with a -Pconvertigo.localBuild.iosSignIdentity as Gradle parameter
197+
// iosSignIdentity = (mode == 'release' ? 'iPhone Distribution' : 'iPhone Developer')
198+
199+
//// define the Android Keystore file used to sign the release APK package
200+
//// can also be configured with a -Pconvertigo.localBuild.androidKeystore as Gradle parameter
201+
// androidKeystore = file('android.keystore')
202+
203+
//// define the Android Keystore password
204+
//// can also be configured with a -Pconvertigo.localBuild.androidKeystorePassword as Gradle parameter
205+
// androidKeystorePassword = ''
206+
207+
//// define the certificate alias, inside the Android Keystore, that sign the release APK package
208+
//// can also be configured with a -Pconvertigo.localBuild.androidAlias as Gradle parameter
209+
// androidAlias = ''
210+
211+
//// define the certificate password, inside the Android Keystore, that sign the release APK package
212+
//// can also be configured with a -Pconvertigo.localBuild.androidPassword as Gradle parameter
213+
// androidPassword = ''
214+
}
215+
216+
//// the 'launchRemoteBuild' task depends on 'remoteBuild' and uploads the mobile source package to the Convertigo Build Gateway
217+
launchRemoteBuild {
218+
219+
}
220+
221+
//// the 'downloadRemoteBuild' task depends on 'launchRemoteBuild' and waits the remote build to finish, then download the native packages (iOS ipa or Android apk)
222+
downloadRemoteBuild {
223+
//// configure the destination of built mobile application packages (default 'build' folder)
224+
//// can also be configured with a -Pconvertigo.downloadRemoteBuild.destinationDir as Gradle parameter
225+
// destinationDir 'build'
226+
227+
doLast {
228+
destinationFiles.each {
229+
println "Downloaded mobile application package: $it"
230+
}
231+
}
232+
}
233+
234+
//// the 'wrapper' task is used to upgrade the Gradle wrapper of the projet
235+
if (!tasks.findByName('wrapper')) {
236+
task wrapper(type: Wrapper) {
237+
group 'build setup'
238+
description 'Generates Gradle wrapper files.'
239+
}
240+
}
241+
wrapper.gradleVersion = '8.5'

c8oProject.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
- user login using OpenID
88
99
'
10-
version: 4.0.6
10+
version: 8.4.0.0
1111
↓void [connectors.SqlConnector]: 🗏 connectors/void.yaml
1212
↓GetSymbols [sequences.GenericSequence]: 🗏 sequences/GetSymbols.yaml
1313
↓project [references.ProjectSchemaReference]:
1414
projectName: mobilebuilder_tpl_8_4_0_ngx=https://github.com/convertigo/c8oprj-mobilebuilder-tpl/archive/mobilebuilder_tpl_8_4_0_ngx.zip
1515
↓Project_reference2 [references.ProjectSchemaReference]:
1616
projectName: lib_OAuth=https://github.com/convertigo/c8oprj-lib-oauth.git:branch=8.0.0:autoPull=true
1717
↓Project_reference_1 [references.ProjectSchemaReference]:
18-
projectName: lib_UserManager=https://github.com/convertigo/c8oprj-lib-user-manager.git:branch=8.0.X
18+
projectName: lib_UserManager=https://github.com/convertigo/c8oprj-lib-user-manager.git:branch=8.0.X:autoPull=true
1919
↓MobileApplication [core.MobileApplication]:
2020
↓Application [ngx.components.ApplicationComponent]: 🗏 mobileApplication.yaml

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)