Skip to content

Commit 4bb6103

Browse files
authored
Merge pull request #20 from stslex/dev
build/update libs/release
2 parents caa5a85 + 212ce64 commit 4bb6103

File tree

176 files changed

+1325
-852
lines changed

Some content is hidden

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

176 files changed

+1325
-852
lines changed

.github/scripts/update_versions.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Define the initial script directory
4+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5+
project_dir="$(dirname "$script_dir")"
6+
project_dir="$(dirname "$project_dir")"
7+
echo "Project script directory: $project_dir"
8+
9+
# Define the path to the target file
10+
version_file="$project_dir/gradle/libs.versions.toml"
11+
12+
# Check if the target file exists
13+
if [ -f "$version_file" ]; then
14+
echo "Target file found: $version_file"
15+
else
16+
echo "Target file not found"
17+
exit 1 # Exit the script if the target file is not found
18+
fi
19+
20+
# Read versionName and versionCode from the file
21+
version_name=$(awk -F '"' '/versionName = "/{print $2}' "$version_file")
22+
version_code=$(awk -F '"' '/versionCode = "/{print $2}' "$version_file")
23+
24+
# Increment versionCode by 1
25+
((version_code++))
26+
27+
# Increment versionName by 0.01
28+
version_name=$(echo "$version_name + 0.01" | bc)
29+
30+
# Update the file with the new version information
31+
sed "s/versionName = \".*\"/versionName = \"$version_name\"/" "$version_file" > "$version_file.tmp"
32+
mv "$version_file.tmp" "$version_file"
33+
34+
sed "s/versionCode = \".*\"/versionCode = \"$version_code\"/" "$version_file" > "$version_file.tmp"
35+
mv "$version_file.tmp" "$version_file"
36+
37+
echo "Updated versionName to $version_name and versionCode to $version_code in $version_file"
38+

.github/workflows/android.yml

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,63 @@ on:
44
push:
55
branches: [ master ]
66
pull_request:
7-
branches: [ master ]
7+
workflow_dispatch:
88

99
jobs:
1010
build:
1111

1212
runs-on: ubuntu-latest
13+
timeout-minutes: 30
1314

1415
steps:
15-
16-
- uses: actions/checkout@v2
17-
18-
- name: restore local properties
19-
env:
20-
LOCAL_PROPERTIES: ${{secrets.LOCAL_PROPERTIES}}
21-
shell: bash
22-
run: |
23-
echo "$LOCAL_PROPERTIES" > ~/home/runner/work/SplashGallery/SplashGallery/local.properties
24-
25-
- name: set up JDK 11
26-
uses: actions/setup-java@v2
27-
with:
28-
java-version: '11'
29-
distribution: 'temurin'
30-
cache: gradle
31-
32-
- name: Setup Android SDK
33-
uses: android-actions/setup-android@v2
34-
35-
- name: Grant execute permission for gradlew
36-
run: chmod +x gradlew
37-
38-
- name: Build with Gradle
39-
run: ./gradlew --no-daemon build
16+
17+
- name: Checkout branch
18+
uses: actions/checkout@v4
19+
- run: |
20+
echo "${{ secrets.KEYSTORE }}" > keystore.jks.asc
21+
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch keystore.jks.asc > keystore.jks
22+
23+
- name: set up JDK 17
24+
uses: actions/setup-java@v3
25+
with:
26+
java-version: '17'
27+
distribution: 'temurin'
28+
cache: gradle
29+
30+
- name: set up LOCAL_PROPERTIES
31+
env:
32+
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
33+
run: echo "$LOCAL_PROPERTIES" > ./local.properties
34+
35+
- name: Configure Keystore
36+
env:
37+
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
38+
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
39+
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
40+
run: |
41+
echo "storeFile=keystore.jks" >> keystore.properties
42+
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties
43+
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties
44+
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties
45+
46+
47+
- name: Cache Gradle
48+
uses: actions/cache@v4
49+
with:
50+
path: ~/.gradle/caches/
51+
key: cache-clean-gradle-${{ matrix.os }}-${{ matrix.jdk }}
52+
53+
- name: Cache Gradle Wrapper
54+
uses: actions/cache@v4
55+
with:
56+
path: ~/.gradle/wrapper/
57+
key: cache-clean-wrapper-${{ matrix.os }}-${{ matrix.jdk }}
58+
59+
- name: Grant execute permission for gradlew
60+
run: chmod +x gradlew
61+
62+
- name: Build with Gradle
63+
run: ./gradlew build
64+
65+
- name: Junit tests with Gradle
66+
run: ./gradlew testDebugUnitTest
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Android Deploy Beta
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy_beta:
10+
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 60
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- run: |
18+
echo "${{ secrets.KEYSTORE }}" > keystore.jks.asc
19+
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch keystore.jks.asc > keystore.jks
20+
21+
- name: Update Version
22+
run: bash ./.github/scripts/update_versions.sh
23+
24+
- uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: '3.3'
27+
28+
- name: Cache Ruby - Bundler
29+
uses: actions/cache@v4
30+
with:
31+
path: vendor/bundle
32+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-gems-
35+
36+
- name: set up JDK 17
37+
uses: actions/setup-java@v3
38+
with:
39+
java-version: '17'
40+
distribution: 'temurin'
41+
cache: gradle
42+
43+
- name: Cache Gradle
44+
uses: actions/cache@v4
45+
with:
46+
path: ~/.gradle/caches/
47+
key: cache-clean-gradle-${{ matrix.os }}-${{ matrix.jdk }}
48+
49+
- name: Cache Gradle Wrapper
50+
uses: actions/cache@v4
51+
with:
52+
path: ~/.gradle/wrapper/
53+
key: cache-clean-wrapper-${{ matrix.os }}-${{ matrix.jdk }}
54+
55+
- name: Grant Permission to Execute
56+
run: chmod +x gradlew
57+
58+
- name: Install bundle
59+
run: |
60+
bundle config path vendor/bundle
61+
bundle install --jobs 4 --retry 3
62+
63+
- name: set up LOCAL_PROPERTIES
64+
env:
65+
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
66+
run: echo "$LOCAL_PROPERTIES" > ./local.properties
67+
68+
- name: Configure Keystore
69+
env:
70+
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
71+
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
72+
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
73+
run: |
74+
echo "storeFile=keystore.jks" >> keystore.properties
75+
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties
76+
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties
77+
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties
78+
79+
- name: Create Google Play Config file
80+
env:
81+
PLAY_CONFIG_JSON: ${{ secrets.PLAY_CONFIG_JSON }}
82+
run: |
83+
echo "$PLAY_CONFIG_JSON" > play_config.json.b64
84+
base64 -d -i play_config.json.b64 > play_config.json
85+
86+
- name: Distribute app to Beta track 🚀
87+
run: bundle exec fastlane beta
88+
89+
- name: Commit files
90+
run: |
91+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
92+
git config --local user.name "github-actions[bot]"
93+
git commit -a -m "update version"
94+
95+
- name: Push changes
96+
uses: ad-m/github-push-action@master
97+
with:
98+
github_token: ${{ secrets.PUSH_TOKEN }}
99+
branch: ${{ github.ref }}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Android Deploy Prod
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy_prod:
8+
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 60
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- run: |
16+
echo "${{ secrets.KEYSTORE }}" > keystore.jks.asc
17+
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch keystore.jks.asc > keystore.jks
18+
19+
- name: Update Version
20+
run: bash ./.github/scripts/update_versions.sh
21+
22+
- uses: ruby/setup-ruby@v1
23+
with:
24+
ruby-version: '3.3'
25+
26+
- name: Cache Ruby - Bundler
27+
uses: actions/cache@v4
28+
with:
29+
path: vendor/bundle
30+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
31+
restore-keys: |
32+
${{ runner.os }}-gems-
33+
34+
- name: set up JDK 17
35+
uses: actions/setup-java@v3
36+
with:
37+
java-version: '17'
38+
distribution: 'temurin'
39+
cache: gradle
40+
41+
- name: Cache Gradle
42+
uses: actions/cache@v4
43+
with:
44+
path: ~/.gradle/caches/
45+
key: cache-clean-gradle-${{ matrix.os }}-${{ matrix.jdk }}
46+
47+
- name: Cache Gradle Wrapper
48+
uses: actions/cache@v4
49+
with:
50+
path: ~/.gradle/wrapper/
51+
key: cache-clean-wrapper-${{ matrix.os }}-${{ matrix.jdk }}
52+
53+
- name: Grant Permission to Execute
54+
run: chmod +x gradlew
55+
56+
- name: Install bundle
57+
run: |
58+
bundle config path vendor/bundle
59+
bundle install --jobs 4 --retry 3
60+
61+
- name: set up LOCAL_PROPERTIES
62+
env:
63+
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}
64+
run: echo "$LOCAL_PROPERTIES" > ./local.properties
65+
66+
- name: Configure Keystore
67+
env:
68+
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
69+
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
70+
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
71+
run: |
72+
echo "storeFile=keystore.jks" >> keystore.properties
73+
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties
74+
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties
75+
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties
76+
77+
- name: Create Google Play Config file
78+
env:
79+
PLAY_CONFIG_JSON: ${{ secrets.PLAY_CONFIG_JSON }}
80+
run: |
81+
echo "$PLAY_CONFIG_JSON" > play_config.json.b64
82+
base64 -d -i play_config.json.b64 > play_config.json
83+
84+
- name: Distribute app to Beta track 🚀
85+
run: bundle exec fastlane deploy
86+
87+
- name: Commit files
88+
run: |
89+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
90+
git config --local user.name "github-actions[bot]"
91+
git commit -a -m "update version"
92+
93+
- name: Push changes
94+
uses: ad-m/github-push-action@master
95+
with:
96+
github_token: ${{ secrets.PUSH_TOKEN }}
97+
branch: ${{ github.ref }}

.gitignore

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
*.iml
22
.gradle
3+
.idea
4+
.kotlin
35
/local.properties
4-
/.idea/caches
5-
/.idea/libraries
6-
/.idea/modules.xml
7-
/.idea/workspace.xml
8-
/.idea/navEditor.xml
9-
/.idea/assetWizardSettings.xml
106
.DS_Store
117
/build
128
/captures
139
.externalNativeBuild
1410
.cxx
15-
/app/release
1611
local.properties
17-
gradle.properties
12+
play_config.*
13+
keystore.*
14+
build

.idea/.gitignore

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

0 commit comments

Comments
 (0)