appmachine 0.0.8 â 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/android.yml +40 -3
- package/src/ios.yml +26 -5
- /package/{README.md â .github/README.md} +0 -0
package/package.json
CHANGED
package/src/android.yml
CHANGED
|
@@ -14,6 +14,7 @@ jobs:
|
|
|
14
14
|
APP_SERVER_URL: ${{ vars.APP_SERVER_URL }}
|
|
15
15
|
APP_ID: ${{ vars.APP_ID }}
|
|
16
16
|
APP_NAME: ${{ vars.APP_NAME }}
|
|
17
|
+
APP_VERSION: ${{ vars.APP_VERSION }} # đ Added here
|
|
17
18
|
ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
|
|
18
19
|
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
|
19
20
|
|
|
@@ -69,11 +70,22 @@ jobs:
|
|
|
69
70
|
set -euo pipefail
|
|
70
71
|
rm -rf android && npx --no-install cap add android
|
|
71
72
|
mkdir -p assets
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
|
|
74
|
+
# Smart Icon Selection
|
|
75
|
+
ICON="appmachine/icon.png"
|
|
76
|
+
if [[ "${{ github.ref }}" == "refs/tags/androiddev" && -f "appmachine/icon.dev.png" ]]; then
|
|
77
|
+
echo "đ¨ Dev Build detected: Using icon.dev.png"
|
|
78
|
+
ICON="appmachine/icon.dev.png"
|
|
79
|
+
fi
|
|
80
|
+
|
|
81
|
+
if [ -f "$ICON" ]; then
|
|
82
|
+
echo "â
Generating assets from: $ICON"
|
|
83
|
+
for f in logo logo-dark splash splash-dark; do cp "$ICON" "assets/$f.png"; done
|
|
75
84
|
npx --no-install capacitor-assets generate --android --assetPath assets
|
|
85
|
+
else
|
|
86
|
+
echo "â ī¸ No icon found at $ICON - skipping asset generation"
|
|
76
87
|
fi
|
|
88
|
+
|
|
77
89
|
npx --no-install cap sync android
|
|
78
90
|
|
|
79
91
|
- name: đ Configure Signing
|
|
@@ -102,6 +114,31 @@ jobs:
|
|
|
102
114
|
if (!s.includes("signing.gradle")) fs.appendFileSync(p, "\napply from: \"signing.gradle\"\n");
|
|
103
115
|
'
|
|
104
116
|
|
|
117
|
+
- name: đ§ Update Version
|
|
118
|
+
run: |
|
|
119
|
+
# Updates versionCode (to Run Number) and versionName (if APP_VERSION set)
|
|
120
|
+
node -e '
|
|
121
|
+
const fs = require("fs");
|
|
122
|
+
const p = "android/app/build.gradle";
|
|
123
|
+
let s = fs.readFileSync(p, "utf8");
|
|
124
|
+
|
|
125
|
+
// 1. Version Code (Build Number)
|
|
126
|
+
const buildNum = process.env.GITHUB_RUN_NUMBER;
|
|
127
|
+
console.log(`đĸ Updating versionCode to: ${buildNum}`);
|
|
128
|
+
s = s.replace(/versionCode\s+\d+/, `versionCode ${buildNum}`);
|
|
129
|
+
|
|
130
|
+
// 2. Version Name (Marketing Version) - Only if APP_VERSION is set
|
|
131
|
+
const vName = process.env.APP_VERSION;
|
|
132
|
+
if (vName) {
|
|
133
|
+
console.log(`đ Updating versionName to: ${vName}`);
|
|
134
|
+
s = s.replace(/versionName\s+"[^"]+"/, `versionName "${vName}"`);
|
|
135
|
+
} else {
|
|
136
|
+
console.log("âšī¸ APP_VERSION not set; keeping existing versionName");
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
fs.writeFileSync(p, s);
|
|
140
|
+
'
|
|
141
|
+
|
|
105
142
|
- name: đī¸ Gradle Build
|
|
106
143
|
run: |
|
|
107
144
|
set -euo pipefail
|
package/src/ios.yml
CHANGED
|
@@ -15,6 +15,7 @@ jobs:
|
|
|
15
15
|
APP_SERVER_URL: ${{ vars.APP_SERVER_URL }}
|
|
16
16
|
APP_ID: ${{ vars.APP_ID }}
|
|
17
17
|
APP_NAME: ${{ vars.APP_NAME }}
|
|
18
|
+
APP_VERSION: ${{ vars.APP_VERSION }}
|
|
18
19
|
IOS_CERT_BASE64: ${{ secrets.IOS_CERT_BASE64 }}
|
|
19
20
|
IOS_CERT_PASSWORD: ${{ secrets.IOS_CERT_PASSWORD }}
|
|
20
21
|
IOS_PROFILE_BASE64: ${{ secrets.IOS_PROFILE_BASE64 }}
|
|
@@ -74,11 +75,22 @@ jobs:
|
|
|
74
75
|
npx --no-install cap add ios
|
|
75
76
|
fi
|
|
76
77
|
|
|
78
|
+
# 4. Assets (Smart Icon Selection)
|
|
77
79
|
mkdir -p assets
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
ICON="appmachine/icon.png"
|
|
81
|
+
|
|
82
|
+
# Logic: If tag is "iosdev" AND "icon.dev.png" exists, use it.
|
|
83
|
+
if [[ "${{ github.ref }}" == "refs/tags/iosdev" && -f "appmachine/icon.dev.png" ]]; then
|
|
84
|
+
echo "đ¨ Dev Build detected: Using icon.dev.png"
|
|
85
|
+
ICON="appmachine/icon.dev.png"
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
if [ -f "$ICON" ]; then
|
|
89
|
+
echo "â
Generating assets from: $ICON"
|
|
90
|
+
for f in logo logo-dark splash splash-dark; do cp "$ICON" "assets/$f.png"; done
|
|
81
91
|
npx --no-install capacitor-assets generate --ios --assetPath assets
|
|
92
|
+
else
|
|
93
|
+
echo "â ī¸ No icon found at $ICON - skipping asset generation"
|
|
82
94
|
fi
|
|
83
95
|
|
|
84
96
|
npx --no-install cap sync ios
|
|
@@ -146,13 +158,22 @@ jobs:
|
|
|
146
158
|
echo "đ ios/App contents:"
|
|
147
159
|
ls -la ios/App
|
|
148
160
|
|
|
149
|
-
# 1.
|
|
161
|
+
# 1. Update Marketing Version (Only if APP_VERSION exists)
|
|
162
|
+
if [ -n "${APP_VERSION:-}" ]; then
|
|
163
|
+
echo "đ Updating Marketing Version to: $APP_VERSION"
|
|
164
|
+
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $APP_VERSION" ios/App/App/Info.plist \
|
|
165
|
+
|| /usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string $APP_VERSION" ios/App/App/Info.plist
|
|
166
|
+
else
|
|
167
|
+
echo "âšī¸ APP_VERSION not set; keeping existing ShortVersionString"
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
# 2. Update Build Number
|
|
150
171
|
BUILD_NUM="${{ github.run_number }}"
|
|
151
172
|
echo "đĸ Updating CFBundleVersion to: $BUILD_NUM"
|
|
152
173
|
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUM" ios/App/App/Info.plist \
|
|
153
174
|
|| /usr/libexec/PlistBuddy -c "Add :CFBundleVersion string $BUILD_NUM" ios/App/App/Info.plist
|
|
154
175
|
|
|
155
|
-
#
|
|
176
|
+
# 3. Set Non-Exempt Encryption to NO
|
|
156
177
|
echo "đĢ Setting ITSAppUsesNonExemptEncryption = NO"
|
|
157
178
|
/usr/libexec/PlistBuddy -c "Set :ITSAppUsesNonExemptEncryption false" ios/App/App/Info.plist \
|
|
158
179
|
|| /usr/libexec/PlistBuddy -c "Add :ITSAppUsesNonExemptEncryption bool false" ios/App/App/Info.plist
|
|
File without changes
|