Skip to content

Commit fefd991

Browse files
committed
feat(build): Migrate develop Push CircleCI to GithubAction
1 parent 6f02936 commit fefd991

File tree

4 files changed

+92
-27
lines changed

4 files changed

+92
-27
lines changed

.github/workflows/deploy-alpah.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: GLPI Android Inventory Library Deploy Alpha
2+
3+
env:
4+
module_app: app
5+
6+
on:
7+
push:
8+
branches:
9+
- "develop"
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Update Android Version code
18+
run: ./gradlew updateVersionCode
19+
20+
- name: Extract Release Version
21+
run: echo "release_version=$(jq -r ".version" package.json)" >> $GITHUB_ENV
22+
23+
- name: Extract App VersionCode
24+
run: echo "app_version_code=$(grep versionCode ./app/src/main/AndroidManifest.xml | cut -d\" -f2)" >> $GITHUB_ENV
25+
26+
- name: Update About Data
27+
run : |
28+
echo "about.version=${{ env.release_version }}" > ./app/src/main/assets/about.properties
29+
echo "about.build=${{ env.app_version_code }}" >> ./app/src/main/assets/about.properties
30+
echo "about.date=$(date "+%a %b %d %H:%M:%S %Y")" >> ./app/src/main/assets/about.properties
31+
echo "about.commit=$(git rev-parse --short "$GITHUB_SHA")" >> ./app/src/main/assets/about.properties
32+
echo "about.commitFull=$(git rev-parse "$GITHUB_SHA")" >> ./app/src/main/assets/about.properties
33+
echo "about.github=https://github.com/glpi-project/android-inventory-agent" >> ./app/src/main/assets/about.properties
34+
35+
- name: Check repo git status
36+
run : git status
37+
38+
# Push Transifex
39+
- name: Push source file using transifex client
40+
uses: transifex/cli-action@v2
41+
with:
42+
args: push
43+
token: ${{ secrets.TX_TOKEN }}
44+
45+
# Clean Transifex CLI
46+
- name: Clean Transifex CLI
47+
run: rm -fr /tmp/tx
48+
49+
# Pull from Transifex
50+
- name: Pull source file using transifex client
51+
uses: transifex/cli-action@v2
52+
with:
53+
args: pull --force --all --minimum-perc=80
54+
token: ${{ secrets.TX_TOKEN }}
55+
56+
# Build app
57+
- name: Build with Gradle
58+
run: ./gradlew assemble
59+
60+
- name: Sign app APK
61+
uses: r0adkll/sign-android-release@v1
62+
# ID used to access action output
63+
id: sign_app
64+
with:
65+
releaseDirectory: app/build/outputs/apk/release
66+
signingKeyBase64: ${{ secrets.SIGN_APK_SIGNING_KEY }}
67+
alias: ${{ secrets.SIGN_APK_ALIAS }}
68+
keyStorePassword: ${{ secrets.SIGN_APP_STOREPASS }}
69+
keyPassword: ${{ secrets.SIGN_APP_KEYPASS }}
70+
env:
71+
# override default build-tools version (29.0.3) -- optional
72+
BUILD_TOOLS_VERSION: "30.0.2"
73+
74+
- name: Push to google play
75+
uses: r0adkll/upload-google-play@v1
76+
with:
77+
serviceAccountJsonPlainText: ${{ secrets.GOOGLE_PLAY_CONSOLE }}
78+
packageName: org.glpi.inventory.agent
79+
releaseFiles: app/build/outputs/apk/release/app-release-unsigned-signed.apk
80+
track: alpha

.tx/config

100644100755
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
[main]
2-
host = https://www.transifex.com
3-
minimum_perc = 80
4-
lang_map = pt_BR: pt-rBR, ru_RU: ru-rRU, fr_FR: fr-rFR, es_MX: es-rMX, es_ES: es-rES, en_GB: en-rGB, ko_KR: ko-rKR, ar_EG: ar-rEG, cs_CZ: cs-rCZ, he_IL: he-rIL, ar_SA: ar-rSA, ca_ES: ca-rES, zh_CN: zh-rCN, nl_NL: nl-rNL, fr: fr, gl_ES: gl-rES, de_DE: de-rDE, hi_IN: hi-rIN, hu_Hu: hu-rHU, it_IT: it-rIT, ja: ja, ja_JP: ja-rJP, pl_PL: pl-rPL, es: es, es_AR: es-rAR, th_TH: th-rTH, ur_PK: ur-rPK, eu_ES: eu-rES
2+
host = https://www.transifex.com
3+
lang_map = es_ES: es-rES, ar_SA: ar-rSA, it_IT: it-rIT, eu_ES: eu-rES, fr_FR: fr-rFR, he_IL: he-rIL, pl_PL: pl-rPL, es_AR: es-rAR, th_TH: th-rTH, pt_BR: pt-rBR, fr: fr, gl_ES: gl-rES, es: es, zh_CN: zh-rCN, ja: ja, ja_JP: ja-rJP, nl_NL: nl-rNL, ko_KR: ko-rKR, cs_CZ: cs-rCZ, hi_IN: hi-rIN, es_MX: es-rMX, en_GB: en-rGB, ca_ES: ca-rES, de_DE: de-rDE, ru_RU: ru-rRU, hu_Hu: hu-rHU, ur_PK: ur-rPK, ar_EG: ar-rEG
54

6-
[android-inventory-agent.stringsxml-android]
7-
file_filter = app/src/main/res/values-<lang>/strings.xml
8-
source_file = app/src/main/res/values/strings.xml
9-
source_lang = en
10-
type = ANDROID
5+
[o:glpi:p:android-inventory-agent:r:stringsxml-android]
6+
file_filter = app/src/main/res/values-<lang>/strings.xml
7+
source_file = app/src/main/res/values/strings.xml
8+
source_lang = en
9+
type = ANDROID
10+
replace_edited_strings = false
11+
keep_translations = false
1112

ci/release.keystore.jks

2.67 KB
Binary file not shown.

fastlane/Fastfile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,28 @@ platform :android do
2323
end
2424

2525
desc "Deploy workflow"
26-
lane :certification do |options|
27-
Fastlane::Actions.sh("pwd", log: true)
28-
Fastlane::Actions.sh("$ANDROID_HOME/build-tools/$BUILD_TOOL/zipalign -v -f -p 4 ../app/build/outputs/apk/release/app-release-unsigned.apk ../app/build/outputs/apk/release/app-release-unsigned-aligned.apk", log: true)
29-
Fastlane::Actions.sh("$ANDROID_HOME/build-tools/$BUILD_TOOL/apksigner sign --ks ../ci/release.keystore --ks-key-alias InventoryAgent --ks-pass pass:"+ options[:storepass] +" --key-pass pass:"+ options[:keypass] +" --out ../app/build/outputs/apk/release/appCertified.apk ../app/build/outputs/apk/release/app-release-unsigned-aligned.apk", log: true)
30-
Fastlane::Actions.sh("$ANDROID_HOME/build-tools/$BUILD_TOOL/apksigner verify ../app/build/outputs/apk/release/appCertified.apk", log: true)
31-
end
3226
lane :beta do |options|
3327
supply(
3428
track: 'beta',
35-
apk: "app/build/outputs/apk/release/appCertified.apk",
29+
apk: "app/build/outputs/apk/release/app-release-unsigned-signed.apk",
3630
skip_upload_aab: true,
3731
changes_not_sent_for_review: true
3832
)
3933
end
4034
lane :alpha do |options|
4135
supply(
4236
track: 'alpha',
43-
apk: "app/build/outputs/apk/release/appCertified.apk",
37+
apk: "app/build/outputs/apk/release/app-release-unsigned-signed.apk",
4438
skip_upload_aab: true,
4539
changes_not_sent_for_review: true
4640
)
4741
end
4842
lane :playstore do |options|
4943
supply(
5044
track: 'production',
51-
apk: "app/build/outputs/apk/release/appCertified.apk",
45+
apk: "app/build/outputs/apk/release/app-release-unsigned-signed.apk",
5246
skip_upload_aab: true,
5347
changes_not_sent_for_review: true
5448
)
5549
end
5650
end
57-
58-
#after_all do |lane|
59-
#UI.error "Something unexpected happened in my_new_action. Attempting to continue."
60-
#end
61-
62-
#error do |lane, exception|
63-
#UI.error "Something unexpected happened in my_new_action. Attempting to continue."
64-
#end
65-
66-
# how to used it fastlane android beta storepass:'#KEYSTORE_PASSWORD' keypass:'#ALIAS_PASSWORD'

0 commit comments

Comments
 (0)