craft-native 0.0.37 → 0.0.49
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/dist/android/src/index.js +268 -0
- package/dist/android/src/index.js.map +10 -0
- package/dist/android/templates/AndroidManifest.xml.template +69 -0
- package/dist/android/templates/CraftBridge.kt.template +3748 -0
- package/dist/android/templates/CraftBridgeExtensions.kt.template +383 -0
- package/dist/android/templates/CraftWidgetProvider.kt.template +246 -0
- package/dist/android/templates/MainActivity.kt.template +109 -0
- package/dist/android/templates/build.gradle.kts.app.template +80 -0
- package/dist/android/templates/build.gradle.kts.project.template +5 -0
- package/dist/android/templates/fastlane/Appfile +25 -0
- package/dist/android/templates/fastlane/Fastfile +192 -0
- package/dist/android/templates/fastlane/Gemfile +7 -0
- package/dist/android/templates/github-workflow-android.yml +248 -0
- package/dist/android/templates/github-workflow-test.yml +329 -0
- package/dist/android/templates/settings.gradle.kts.template +18 -0
- package/dist/android/templates/test-bridges.html +1463 -0
- package/dist/api/window.d.ts +18 -0
- package/dist/api/window.d.ts.map +1 -1
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/bridge/core.d.ts +2 -0
- package/dist/bridge/core.d.ts.map +1 -1
- package/dist/cli.js +4168 -0
- package/dist/components/sidebar.d.ts +5 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/dev/devtools.d.ts +1 -1
- package/dist/dev/devtools.d.ts.map +1 -1
- package/dist/dev/hot-reload.d.ts +12 -3
- package/dist/dev/hot-reload.d.ts.map +1 -1
- package/dist/index.cjs +573 -208
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +585 -216
- package/dist/index.js.map +45 -0
- package/dist/ios/src/index.js +186 -0
- package/dist/ios/src/index.js.map +10 -0
- package/dist/ios/templates/CraftApp.swift +4241 -0
- package/dist/ios/templates/CraftAppExtensions.swift +361 -0
- package/dist/ios/templates/CraftWidget.swift +247 -0
- package/dist/ios/templates/Info.plist.template +65 -0
- package/dist/ios/templates/fastlane/Appfile +45 -0
- package/dist/ios/templates/fastlane/Fastfile +189 -0
- package/dist/ios/templates/fastlane/Gemfile +7 -0
- package/dist/ios/templates/fastlane/Matchfile +58 -0
- package/dist/ios/templates/github-workflow-ios.yml +192 -0
- package/dist/ios/templates/github-workflow-release.yml +175 -0
- package/dist/ios/templates/github-workflow-test.yml +272 -0
- package/dist/ios/templates/project.yml.template +25 -0
- package/dist/ios/templates/test-bridges.html +1463 -0
- package/dist/package.d.ts +106 -2
- package/dist/package.d.ts.map +1 -1
- package/dist/package.test.d.ts +2 -0
- package/dist/package.test.d.ts.map +1 -0
- package/dist/styles/sidebar-templates.d.ts.map +1 -1
- package/dist/styles/sidebars.d.ts +12 -8
- package/dist/styles/sidebars.d.ts.map +1 -1
- package/dist/templates/projects/blank/craft.config.ts +19 -0
- package/dist/templates/projects/blank/index.html +27 -0
- package/dist/templates/projects/blank/package.json +19 -0
- package/dist/templates/projects/blank/src/main.ts +26 -0
- package/dist/templates/projects/dashboard/craft.config.ts +42 -0
- package/dist/templates/projects/dashboard/index.html +13 -0
- package/dist/templates/projects/dashboard/package.json +20 -0
- package/dist/templates/projects/dashboard/src/main.ts +163 -0
- package/dist/templates/projects/dashboard/src/styles.css +280 -0
- package/dist/templates/projects/drawer/craft.config.ts +47 -0
- package/dist/templates/projects/drawer/index.html +13 -0
- package/dist/templates/projects/drawer/package.json +21 -0
- package/dist/templates/projects/drawer/src/main.ts +406 -0
- package/dist/templates/projects/drawer/src/styles.css +468 -0
- package/dist/templates/projects/ecommerce/craft.config.ts +32 -0
- package/dist/templates/projects/ecommerce/index.html +13 -0
- package/dist/templates/projects/ecommerce/package.json +19 -0
- package/dist/templates/projects/ecommerce/src/main.ts +194 -0
- package/dist/templates/projects/ecommerce/src/styles.css +169 -0
- package/dist/templates/projects/social/craft.config.ts +32 -0
- package/dist/templates/projects/social/index.html +13 -0
- package/dist/templates/projects/social/package.json +19 -0
- package/dist/templates/projects/social/src/main.ts +270 -0
- package/dist/templates/projects/social/src/styles.css +216 -0
- package/dist/templates/projects/tabs/craft.config.ts +47 -0
- package/dist/templates/projects/tabs/index.html +13 -0
- package/dist/templates/projects/tabs/package.json +21 -0
- package/dist/templates/projects/tabs/src/main.ts +177 -0
- package/dist/templates/projects/tabs/src/styles.css +163 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/updater/index.d.ts +1 -0
- package/dist/updater/index.d.ts.map +1 -1
- package/package.json +5 -12
- package/bin/cli.ts +0 -937
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Fastlane Appfile
|
|
2
|
+
# Stores App Store Connect and Apple Developer account information
|
|
3
|
+
|
|
4
|
+
# App Store Connect API Key (recommended for CI)
|
|
5
|
+
# app_store_connect_api_key(
|
|
6
|
+
# key_id: "YOUR_KEY_ID",
|
|
7
|
+
# issuer_id: "YOUR_ISSUER_ID",
|
|
8
|
+
# key_filepath: "./AuthKey_YOUR_KEY_ID.p8",
|
|
9
|
+
# in_house: false # Set to true for Enterprise accounts
|
|
10
|
+
# )
|
|
11
|
+
|
|
12
|
+
# Or use username/password authentication
|
|
13
|
+
# apple_id("your@email.com")
|
|
14
|
+
|
|
15
|
+
# Your app's bundle identifier
|
|
16
|
+
# app_identifier("com.yourcompany.craftapp")
|
|
17
|
+
|
|
18
|
+
# Your Apple Developer Team ID
|
|
19
|
+
# team_id("XXXXXXXXXX")
|
|
20
|
+
|
|
21
|
+
# App Store Connect Team ID (if different from Developer Portal)
|
|
22
|
+
# itc_team_id("XXXXXXXXXX")
|
|
23
|
+
|
|
24
|
+
# ==================== Example Configuration ====================
|
|
25
|
+
# Uncomment and modify:
|
|
26
|
+
|
|
27
|
+
# app_identifier("com.yourcompany.craftapp")
|
|
28
|
+
# apple_id("developer@yourcompany.com")
|
|
29
|
+
# team_id("ABCD1234XY")
|
|
30
|
+
# itc_team_id("ABCD1234XY")
|
|
31
|
+
|
|
32
|
+
# ==================== For CI/CD ====================
|
|
33
|
+
# Use App Store Connect API Key instead of username/password
|
|
34
|
+
# 1. Go to App Store Connect > Users and Access > Keys
|
|
35
|
+
# 2. Create a new API Key
|
|
36
|
+
# 3. Download the .p8 file
|
|
37
|
+
# 4. Store key_id, issuer_id, and key content as secrets
|
|
38
|
+
#
|
|
39
|
+
# In your Fastfile:
|
|
40
|
+
# api_key = app_store_connect_api_key(
|
|
41
|
+
# key_id: ENV["ASC_KEY_ID"],
|
|
42
|
+
# issuer_id: ENV["ASC_ISSUER_ID"],
|
|
43
|
+
# key_content: ENV["ASC_KEY_CONTENT"],
|
|
44
|
+
# is_key_content_base64: true
|
|
45
|
+
# )
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# Craft iOS Fastlane Configuration
|
|
2
|
+
# Copy this directory to your ios/ folder
|
|
3
|
+
# Run: cd ios && bundle install && bundle exec fastlane <lane>
|
|
4
|
+
|
|
5
|
+
default_platform(:ios)
|
|
6
|
+
|
|
7
|
+
platform :ios do
|
|
8
|
+
# ==================== Setup ====================
|
|
9
|
+
|
|
10
|
+
desc "Setup code signing with match"
|
|
11
|
+
lane :setup_signing do
|
|
12
|
+
match(type: "development")
|
|
13
|
+
match(type: "appstore")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc "Register new device for development"
|
|
17
|
+
lane :add_device do |options|
|
|
18
|
+
device_name = options[:name] || prompt(text: "Device name: ")
|
|
19
|
+
device_udid = options[:udid] || prompt(text: "Device UDID: ")
|
|
20
|
+
|
|
21
|
+
register_devices(
|
|
22
|
+
devices: { device_name => device_udid }
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
match(type: "development", force_for_new_devices: true)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# ==================== Build ====================
|
|
29
|
+
|
|
30
|
+
desc "Build for development"
|
|
31
|
+
lane :build_debug do
|
|
32
|
+
gym(
|
|
33
|
+
scheme: "CraftApp",
|
|
34
|
+
configuration: "Debug",
|
|
35
|
+
export_method: "development",
|
|
36
|
+
output_directory: "./build",
|
|
37
|
+
output_name: "CraftApp-Debug.ipa"
|
|
38
|
+
)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
desc "Build for App Store"
|
|
42
|
+
lane :build_release do
|
|
43
|
+
# Ensure certificates are installed
|
|
44
|
+
match(type: "appstore", readonly: true)
|
|
45
|
+
|
|
46
|
+
# Increment build number
|
|
47
|
+
increment_build_number(xcodeproj: "CraftApp.xcodeproj")
|
|
48
|
+
|
|
49
|
+
# Build
|
|
50
|
+
gym(
|
|
51
|
+
scheme: "CraftApp",
|
|
52
|
+
configuration: "Release",
|
|
53
|
+
export_method: "app-store",
|
|
54
|
+
output_directory: "./build",
|
|
55
|
+
output_name: "CraftApp-Release.ipa",
|
|
56
|
+
include_bitcode: false
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
desc "Build for Ad-Hoc distribution"
|
|
61
|
+
lane :build_adhoc do
|
|
62
|
+
match(type: "adhoc", readonly: true)
|
|
63
|
+
|
|
64
|
+
increment_build_number(xcodeproj: "CraftApp.xcodeproj")
|
|
65
|
+
|
|
66
|
+
gym(
|
|
67
|
+
scheme: "CraftApp",
|
|
68
|
+
configuration: "Release",
|
|
69
|
+
export_method: "ad-hoc",
|
|
70
|
+
output_directory: "./build",
|
|
71
|
+
output_name: "CraftApp-AdHoc.ipa"
|
|
72
|
+
)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# ==================== Deploy ====================
|
|
76
|
+
|
|
77
|
+
desc "Upload to TestFlight"
|
|
78
|
+
lane :beta do
|
|
79
|
+
build_release
|
|
80
|
+
|
|
81
|
+
upload_to_testflight(
|
|
82
|
+
skip_waiting_for_build_processing: true,
|
|
83
|
+
distribute_external: false
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
# Notify Slack (optional)
|
|
87
|
+
# slack(
|
|
88
|
+
# message: "New TestFlight build uploaded! 🚀",
|
|
89
|
+
# channel: "#mobile-releases"
|
|
90
|
+
# )
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
desc "Upload to App Store"
|
|
94
|
+
lane :release do
|
|
95
|
+
build_release
|
|
96
|
+
|
|
97
|
+
upload_to_app_store(
|
|
98
|
+
skip_metadata: false,
|
|
99
|
+
skip_screenshots: true,
|
|
100
|
+
submit_for_review: false,
|
|
101
|
+
automatic_release: false,
|
|
102
|
+
precheck_include_in_app_purchases: false
|
|
103
|
+
)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# ==================== Testing ====================
|
|
107
|
+
|
|
108
|
+
desc "Run tests"
|
|
109
|
+
lane :test do
|
|
110
|
+
run_tests(
|
|
111
|
+
scheme: "CraftApp",
|
|
112
|
+
device: "iPhone 15",
|
|
113
|
+
code_coverage: true
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
desc "Run tests and report coverage"
|
|
118
|
+
lane :test_coverage do
|
|
119
|
+
run_tests(
|
|
120
|
+
scheme: "CraftApp",
|
|
121
|
+
device: "iPhone 15",
|
|
122
|
+
code_coverage: true,
|
|
123
|
+
output_directory: "./build/test-results"
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
# Generate coverage report (requires xcov)
|
|
127
|
+
# xcov(
|
|
128
|
+
# scheme: "CraftApp",
|
|
129
|
+
# output_directory: "./build/coverage"
|
|
130
|
+
# )
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# ==================== Version Management ====================
|
|
134
|
+
|
|
135
|
+
desc "Bump version number"
|
|
136
|
+
lane :bump_version do |options|
|
|
137
|
+
bump_type = options[:type] || "patch" # major, minor, patch
|
|
138
|
+
increment_version_number(bump_type: bump_type)
|
|
139
|
+
version = get_version_number
|
|
140
|
+
UI.message("Version bumped to #{version}")
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
desc "Set version number"
|
|
144
|
+
lane :set_version do |options|
|
|
145
|
+
version = options[:version] || prompt(text: "Version number: ")
|
|
146
|
+
increment_version_number(version_number: version)
|
|
147
|
+
UI.message("Version set to #{version}")
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
# ==================== Utilities ====================
|
|
151
|
+
|
|
152
|
+
desc "Clean build artifacts"
|
|
153
|
+
lane :clean do
|
|
154
|
+
clear_derived_data
|
|
155
|
+
sh("rm -rf ../build")
|
|
156
|
+
UI.success("Build artifacts cleaned!")
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
desc "Sync certificates"
|
|
160
|
+
lane :sync_certs do
|
|
161
|
+
match(type: "development", readonly: true)
|
|
162
|
+
match(type: "appstore", readonly: true)
|
|
163
|
+
match(type: "adhoc", readonly: true)
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# ==================== CI/CD ====================
|
|
167
|
+
|
|
168
|
+
desc "CI build and test"
|
|
169
|
+
lane :ci do
|
|
170
|
+
test
|
|
171
|
+
build_release
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
desc "CI deploy to TestFlight"
|
|
175
|
+
lane :ci_beta do
|
|
176
|
+
setup_ci
|
|
177
|
+
|
|
178
|
+
# Install certificates from match
|
|
179
|
+
match(
|
|
180
|
+
type: "appstore",
|
|
181
|
+
readonly: true,
|
|
182
|
+
keychain_name: "fastlane_tmp_keychain",
|
|
183
|
+
keychain_password: ""
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
build_release
|
|
187
|
+
upload_to_testflight(skip_waiting_for_build_processing: true)
|
|
188
|
+
end
|
|
189
|
+
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Fastlane Match Configuration
|
|
2
|
+
# Match manages iOS code signing certificates and provisioning profiles
|
|
3
|
+
# Certificates are stored in a private Git repository
|
|
4
|
+
|
|
5
|
+
# Git repository for storing certificates
|
|
6
|
+
# git_url("git@github.com:your-org/certificates.git")
|
|
7
|
+
|
|
8
|
+
# App identifier (bundle ID)
|
|
9
|
+
# app_identifier(["com.yourcompany.craftapp"])
|
|
10
|
+
|
|
11
|
+
# Your Apple Developer account
|
|
12
|
+
# username("your@email.com")
|
|
13
|
+
|
|
14
|
+
# Team ID (find in Developer Portal)
|
|
15
|
+
# team_id("XXXXXXXXXX")
|
|
16
|
+
|
|
17
|
+
# Storage mode: git, google_cloud, or s3
|
|
18
|
+
# storage_mode("git")
|
|
19
|
+
|
|
20
|
+
# Keychain for CI
|
|
21
|
+
# keychain_name(ENV["MATCH_KEYCHAIN_NAME"] || "login.keychain-db")
|
|
22
|
+
|
|
23
|
+
# ==================== Example Configuration ====================
|
|
24
|
+
# Uncomment and modify the following for your project:
|
|
25
|
+
|
|
26
|
+
# git_url("git@github.com:your-org/ios-certificates.git")
|
|
27
|
+
#
|
|
28
|
+
# app_identifier(["com.yourcompany.craftapp"])
|
|
29
|
+
# username("developer@yourcompany.com")
|
|
30
|
+
# team_id("ABCD1234XY")
|
|
31
|
+
#
|
|
32
|
+
# storage_mode("git")
|
|
33
|
+
#
|
|
34
|
+
# # For CI environments
|
|
35
|
+
# readonly(is_ci)
|
|
36
|
+
#
|
|
37
|
+
# # Types of profiles to manage
|
|
38
|
+
# type("development") # or "appstore", "adhoc", "enterprise"
|
|
39
|
+
|
|
40
|
+
# ==================== Usage ====================
|
|
41
|
+
# Initialize match (first time):
|
|
42
|
+
# fastlane match init
|
|
43
|
+
#
|
|
44
|
+
# Generate development certificates:
|
|
45
|
+
# fastlane match development
|
|
46
|
+
#
|
|
47
|
+
# Generate App Store certificates:
|
|
48
|
+
# fastlane match appstore
|
|
49
|
+
#
|
|
50
|
+
# Generate Ad-Hoc certificates:
|
|
51
|
+
# fastlane match adhoc
|
|
52
|
+
#
|
|
53
|
+
# Sync certificates (readonly):
|
|
54
|
+
# fastlane match development --readonly
|
|
55
|
+
#
|
|
56
|
+
# Force regenerate all certificates:
|
|
57
|
+
# fastlane match nuke development
|
|
58
|
+
# fastlane match nuke distribution
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
# iOS Build and Test Workflow
|
|
2
|
+
# Copy this file to your project's .github/workflows/ios.yml
|
|
3
|
+
|
|
4
|
+
name: iOS Build
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [main, develop]
|
|
9
|
+
paths:
|
|
10
|
+
- 'ios/**'
|
|
11
|
+
- '*.swift'
|
|
12
|
+
- '*.xcodeproj/**'
|
|
13
|
+
- '*.xcworkspace/**'
|
|
14
|
+
pull_request:
|
|
15
|
+
branches: [main]
|
|
16
|
+
paths:
|
|
17
|
+
- 'ios/**'
|
|
18
|
+
- '*.swift'
|
|
19
|
+
- '*.xcodeproj/**'
|
|
20
|
+
- '*.xcworkspace/**'
|
|
21
|
+
workflow_dispatch:
|
|
22
|
+
|
|
23
|
+
env:
|
|
24
|
+
XCODE_VERSION: '15.0'
|
|
25
|
+
SCHEME: 'CraftApp'
|
|
26
|
+
PROJECT_PATH: 'ios/CraftApp.xcodeproj'
|
|
27
|
+
|
|
28
|
+
jobs:
|
|
29
|
+
build:
|
|
30
|
+
name: Build iOS App
|
|
31
|
+
runs-on: macos-14
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- name: Checkout
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- name: Select Xcode
|
|
38
|
+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
|
|
39
|
+
|
|
40
|
+
- name: Show Xcode version
|
|
41
|
+
run: xcodebuild -version
|
|
42
|
+
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: |
|
|
45
|
+
if [ -f "ios/Podfile" ]; then
|
|
46
|
+
cd ios && pod install
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
- name: Build Debug
|
|
50
|
+
run: |
|
|
51
|
+
xcodebuild build \
|
|
52
|
+
-project "${{ env.PROJECT_PATH }}" \
|
|
53
|
+
-scheme "${{ env.SCHEME }}" \
|
|
54
|
+
-configuration Debug \
|
|
55
|
+
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.0' \
|
|
56
|
+
CODE_SIGN_IDENTITY="" \
|
|
57
|
+
CODE_SIGNING_REQUIRED=NO \
|
|
58
|
+
CODE_SIGNING_ALLOWED=NO \
|
|
59
|
+
| xcpretty
|
|
60
|
+
|
|
61
|
+
- name: Run Tests
|
|
62
|
+
run: |
|
|
63
|
+
xcodebuild test \
|
|
64
|
+
-project "${{ env.PROJECT_PATH }}" \
|
|
65
|
+
-scheme "${{ env.SCHEME }}" \
|
|
66
|
+
-destination 'platform=iOS Simulator,name=iPhone 15,OS=17.0' \
|
|
67
|
+
CODE_SIGN_IDENTITY="" \
|
|
68
|
+
CODE_SIGNING_REQUIRED=NO \
|
|
69
|
+
| xcpretty
|
|
70
|
+
|
|
71
|
+
build-release:
|
|
72
|
+
name: Build Release
|
|
73
|
+
runs-on: macos-14
|
|
74
|
+
needs: build
|
|
75
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
76
|
+
|
|
77
|
+
steps:
|
|
78
|
+
- name: Checkout
|
|
79
|
+
uses: actions/checkout@v4
|
|
80
|
+
|
|
81
|
+
- name: Select Xcode
|
|
82
|
+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
|
|
83
|
+
|
|
84
|
+
- name: Install dependencies
|
|
85
|
+
run: |
|
|
86
|
+
if [ -f "ios/Podfile" ]; then
|
|
87
|
+
cd ios && pod install
|
|
88
|
+
fi
|
|
89
|
+
|
|
90
|
+
- name: Build Release (unsigned)
|
|
91
|
+
run: |
|
|
92
|
+
xcodebuild build \
|
|
93
|
+
-project "${{ env.PROJECT_PATH }}" \
|
|
94
|
+
-scheme "${{ env.SCHEME }}" \
|
|
95
|
+
-configuration Release \
|
|
96
|
+
-destination 'generic/platform=iOS' \
|
|
97
|
+
CODE_SIGN_IDENTITY="" \
|
|
98
|
+
CODE_SIGNING_REQUIRED=NO \
|
|
99
|
+
CODE_SIGNING_ALLOWED=NO \
|
|
100
|
+
ONLY_ACTIVE_ARCH=NO \
|
|
101
|
+
| xcpretty
|
|
102
|
+
|
|
103
|
+
- name: Archive (unsigned)
|
|
104
|
+
run: |
|
|
105
|
+
xcodebuild archive \
|
|
106
|
+
-project "${{ env.PROJECT_PATH }}" \
|
|
107
|
+
-scheme "${{ env.SCHEME }}" \
|
|
108
|
+
-configuration Release \
|
|
109
|
+
-archivePath build/CraftApp.xcarchive \
|
|
110
|
+
CODE_SIGN_IDENTITY="" \
|
|
111
|
+
CODE_SIGNING_REQUIRED=NO \
|
|
112
|
+
CODE_SIGNING_ALLOWED=NO \
|
|
113
|
+
| xcpretty
|
|
114
|
+
|
|
115
|
+
- name: Upload Archive
|
|
116
|
+
uses: actions/upload-artifact@v4
|
|
117
|
+
with:
|
|
118
|
+
name: ios-archive
|
|
119
|
+
path: build/CraftApp.xcarchive
|
|
120
|
+
retention-days: 7
|
|
121
|
+
|
|
122
|
+
# Optional: Signed build for App Store
|
|
123
|
+
# Requires: APPLE_CERTIFICATE_P12, APPLE_CERTIFICATE_PASSWORD,
|
|
124
|
+
# APPLE_PROVISIONING_PROFILE, KEYCHAIN_PASSWORD secrets
|
|
125
|
+
build-signed:
|
|
126
|
+
name: Build Signed Release
|
|
127
|
+
runs-on: macos-14
|
|
128
|
+
needs: build
|
|
129
|
+
if: false # Set to true when you have signing configured
|
|
130
|
+
|
|
131
|
+
steps:
|
|
132
|
+
- name: Checkout
|
|
133
|
+
uses: actions/checkout@v4
|
|
134
|
+
|
|
135
|
+
- name: Select Xcode
|
|
136
|
+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
|
|
137
|
+
|
|
138
|
+
- name: Install Apple Certificate
|
|
139
|
+
env:
|
|
140
|
+
CERTIFICATE_P12: ${{ secrets.APPLE_CERTIFICATE_P12 }}
|
|
141
|
+
CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
|
142
|
+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
|
|
143
|
+
run: |
|
|
144
|
+
# Create temporary keychain
|
|
145
|
+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
|
|
146
|
+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
147
|
+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
|
|
148
|
+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
149
|
+
|
|
150
|
+
# Import certificate
|
|
151
|
+
echo "$CERTIFICATE_P12" | base64 --decode > certificate.p12
|
|
152
|
+
security import certificate.p12 -P "$CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
|
|
153
|
+
security list-keychain -d user -s $KEYCHAIN_PATH
|
|
154
|
+
|
|
155
|
+
# Allow codesign to access keychain
|
|
156
|
+
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
|
|
157
|
+
|
|
158
|
+
- name: Install Provisioning Profile
|
|
159
|
+
env:
|
|
160
|
+
PROVISIONING_PROFILE: ${{ secrets.APPLE_PROVISIONING_PROFILE }}
|
|
161
|
+
run: |
|
|
162
|
+
echo "$PROVISIONING_PROFILE" | base64 --decode > profile.mobileprovision
|
|
163
|
+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
|
|
164
|
+
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/
|
|
165
|
+
|
|
166
|
+
- name: Build and Archive
|
|
167
|
+
run: |
|
|
168
|
+
xcodebuild archive \
|
|
169
|
+
-project "${{ env.PROJECT_PATH }}" \
|
|
170
|
+
-scheme "${{ env.SCHEME }}" \
|
|
171
|
+
-configuration Release \
|
|
172
|
+
-archivePath build/CraftApp.xcarchive \
|
|
173
|
+
| xcpretty
|
|
174
|
+
|
|
175
|
+
- name: Export IPA
|
|
176
|
+
run: |
|
|
177
|
+
xcodebuild -exportArchive \
|
|
178
|
+
-archivePath build/CraftApp.xcarchive \
|
|
179
|
+
-exportPath build/export \
|
|
180
|
+
-exportOptionsPlist ios/ExportOptions.plist \
|
|
181
|
+
| xcpretty
|
|
182
|
+
|
|
183
|
+
- name: Upload IPA
|
|
184
|
+
uses: actions/upload-artifact@v4
|
|
185
|
+
with:
|
|
186
|
+
name: ios-ipa
|
|
187
|
+
path: build/export/*.ipa
|
|
188
|
+
retention-days: 7
|
|
189
|
+
|
|
190
|
+
- name: Cleanup Keychain
|
|
191
|
+
if: always()
|
|
192
|
+
run: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Mobile Release Workflow
|
|
2
|
+
# Copy this file to your project's .github/workflows/release.yml
|
|
3
|
+
# Builds both iOS and Android apps on tag push
|
|
4
|
+
|
|
5
|
+
name: Mobile Release
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
tags:
|
|
10
|
+
- 'v*'
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
inputs:
|
|
13
|
+
version:
|
|
14
|
+
description: 'Version number (e.g., 1.2.3)'
|
|
15
|
+
required: true
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
XCODE_VERSION: '15.0'
|
|
19
|
+
JAVA_VERSION: '17'
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
# ==================== iOS Release ====================
|
|
23
|
+
ios-release:
|
|
24
|
+
name: Build iOS Release
|
|
25
|
+
runs-on: macos-14
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout
|
|
29
|
+
uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- name: Select Xcode
|
|
32
|
+
run: sudo xcode-select -s /Applications/Xcode_${{ env.XCODE_VERSION }}.app
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: |
|
|
36
|
+
if [ -f "ios/Podfile" ]; then
|
|
37
|
+
cd ios && pod install
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
- name: Set version
|
|
41
|
+
run: |
|
|
42
|
+
VERSION="${{ github.event.inputs.version || github.ref_name }}"
|
|
43
|
+
VERSION="${VERSION#v}" # Remove 'v' prefix if present
|
|
44
|
+
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
45
|
+
|
|
46
|
+
# Update Info.plist version
|
|
47
|
+
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $VERSION" ios/CraftApp/Info.plist
|
|
48
|
+
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${{ github.run_number }}" ios/CraftApp/Info.plist
|
|
49
|
+
|
|
50
|
+
- name: Build Archive (unsigned)
|
|
51
|
+
run: |
|
|
52
|
+
xcodebuild archive \
|
|
53
|
+
-project ios/CraftApp.xcodeproj \
|
|
54
|
+
-scheme CraftApp \
|
|
55
|
+
-configuration Release \
|
|
56
|
+
-archivePath build/CraftApp.xcarchive \
|
|
57
|
+
CODE_SIGN_IDENTITY="" \
|
|
58
|
+
CODE_SIGNING_REQUIRED=NO \
|
|
59
|
+
CODE_SIGNING_ALLOWED=NO \
|
|
60
|
+
| xcpretty
|
|
61
|
+
|
|
62
|
+
- name: Upload iOS Archive
|
|
63
|
+
uses: actions/upload-artifact@v4
|
|
64
|
+
with:
|
|
65
|
+
name: ios-release-${{ env.VERSION }}
|
|
66
|
+
path: build/CraftApp.xcarchive
|
|
67
|
+
retention-days: 30
|
|
68
|
+
|
|
69
|
+
# ==================== Android Release ====================
|
|
70
|
+
android-release:
|
|
71
|
+
name: Build Android Release
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
|
|
74
|
+
steps:
|
|
75
|
+
- name: Checkout
|
|
76
|
+
uses: actions/checkout@v4
|
|
77
|
+
|
|
78
|
+
- name: Set up JDK
|
|
79
|
+
uses: actions/setup-java@v4
|
|
80
|
+
with:
|
|
81
|
+
java-version: ${{ env.JAVA_VERSION }}
|
|
82
|
+
distribution: 'temurin'
|
|
83
|
+
cache: 'gradle'
|
|
84
|
+
|
|
85
|
+
- name: Set version
|
|
86
|
+
run: |
|
|
87
|
+
VERSION="${{ github.event.inputs.version || github.ref_name }}"
|
|
88
|
+
VERSION="${VERSION#v}" # Remove 'v' prefix if present
|
|
89
|
+
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
90
|
+
|
|
91
|
+
# Update build.gradle version
|
|
92
|
+
sed -i "s/versionName \".*\"/versionName \"$VERSION\"/" android/app/build.gradle
|
|
93
|
+
sed -i "s/versionCode [0-9]*/versionCode ${{ github.run_number }}/" android/app/build.gradle
|
|
94
|
+
|
|
95
|
+
- name: Grant execute permission
|
|
96
|
+
run: chmod +x android/gradlew
|
|
97
|
+
|
|
98
|
+
- name: Build Release APK
|
|
99
|
+
working-directory: android
|
|
100
|
+
run: ./gradlew assembleRelease
|
|
101
|
+
|
|
102
|
+
- name: Build Release Bundle
|
|
103
|
+
working-directory: android
|
|
104
|
+
run: ./gradlew bundleRelease
|
|
105
|
+
|
|
106
|
+
- name: Upload Android APK
|
|
107
|
+
uses: actions/upload-artifact@v4
|
|
108
|
+
with:
|
|
109
|
+
name: android-apk-${{ env.VERSION }}
|
|
110
|
+
path: android/app/build/outputs/apk/release/*.apk
|
|
111
|
+
retention-days: 30
|
|
112
|
+
|
|
113
|
+
- name: Upload Android Bundle
|
|
114
|
+
uses: actions/upload-artifact@v4
|
|
115
|
+
with:
|
|
116
|
+
name: android-bundle-${{ env.VERSION }}
|
|
117
|
+
path: android/app/build/outputs/bundle/release/*.aab
|
|
118
|
+
retention-days: 30
|
|
119
|
+
|
|
120
|
+
# ==================== Create GitHub Release ====================
|
|
121
|
+
create-release:
|
|
122
|
+
name: Create GitHub Release
|
|
123
|
+
runs-on: ubuntu-latest
|
|
124
|
+
needs: [ios-release, android-release]
|
|
125
|
+
permissions:
|
|
126
|
+
contents: write
|
|
127
|
+
|
|
128
|
+
steps:
|
|
129
|
+
- name: Checkout
|
|
130
|
+
uses: actions/checkout@v4
|
|
131
|
+
|
|
132
|
+
- name: Set version
|
|
133
|
+
run: |
|
|
134
|
+
VERSION="${{ github.event.inputs.version || github.ref_name }}"
|
|
135
|
+
VERSION="${VERSION#v}"
|
|
136
|
+
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
137
|
+
|
|
138
|
+
- name: Download iOS Artifact
|
|
139
|
+
uses: actions/download-artifact@v4
|
|
140
|
+
with:
|
|
141
|
+
name: ios-release-${{ env.VERSION }}
|
|
142
|
+
path: release/ios
|
|
143
|
+
|
|
144
|
+
- name: Download Android APK
|
|
145
|
+
uses: actions/download-artifact@v4
|
|
146
|
+
with:
|
|
147
|
+
name: android-apk-${{ env.VERSION }}
|
|
148
|
+
path: release/android
|
|
149
|
+
|
|
150
|
+
- name: Download Android Bundle
|
|
151
|
+
uses: actions/download-artifact@v4
|
|
152
|
+
with:
|
|
153
|
+
name: android-bundle-${{ env.VERSION }}
|
|
154
|
+
path: release/android
|
|
155
|
+
|
|
156
|
+
- name: Create Zip Archives
|
|
157
|
+
run: |
|
|
158
|
+
cd release
|
|
159
|
+
zip -r ios-archive-${{ env.VERSION }}.zip ios/
|
|
160
|
+
mv android/*.apk . 2>/dev/null || true
|
|
161
|
+
mv android/*.aab . 2>/dev/null || true
|
|
162
|
+
|
|
163
|
+
- name: Create Release
|
|
164
|
+
uses: softprops/action-gh-release@v1
|
|
165
|
+
with:
|
|
166
|
+
name: v${{ env.VERSION }}
|
|
167
|
+
tag_name: ${{ github.ref_name }}
|
|
168
|
+
draft: true
|
|
169
|
+
generate_release_notes: true
|
|
170
|
+
files: |
|
|
171
|
+
release/ios-archive-*.zip
|
|
172
|
+
release/*.apk
|
|
173
|
+
release/*.aab
|
|
174
|
+
env:
|
|
175
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|