Using EAS update

This commit is contained in:
xmflsct 2022-08-16 22:39:54 +02:00
parent d0bdb08bbe
commit 70c90b6a47
15 changed files with 40 additions and 44 deletions

View File

@ -100,6 +100,7 @@ jobs:
uses: expo/expo-github-action@v7
with:
expo-version: latest
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: -- Step 5 -- Install node dependencies
run: yarn install
@ -120,3 +121,6 @@ jobs:
GH_PAT_GET_RELEASE: ${{ secrets.GITHUB_TOKEN }}
FL_GITHUB_RELEASE_API_BEARER: ${{ secrets.GITHUB_TOKEN }}
run: yarn app:build release
- name: -- Step 8 -- Publish expo update
run: eas update --non-interactive --auto

View File

@ -171,7 +171,7 @@ android {
}
}
manifestPlaceholders = [
expoSDK: project.hasProperty('expoSDK') ? project.property('expoSDK') : "",
runtimeVersion: project.hasProperty('runtimeVersion') ? project.property('runtimeVersion') : "",
releaseChannel: project.hasProperty('releaseChannel') ? project.property('releaseChannel') : "default"
]
}

View File

@ -13,11 +13,11 @@
<!-- [Custom] Expo Notifications -->
<meta-data android:name="expo.modules.notifications.default_notification_icon" android:resource="@drawable/ic_stat_notifications" />
<!-- [Custom] End Expo Notifications -->
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@xmflsct/tooot"/>
<meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="${expoSDK}"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/3288313f-3ff0-496a-a5a9-d8985e7cad5f"/>
<meta-data android:name="expo.modules.updates.EXPO_RUNTIME_VERSION" android:value="${runtimeVersion}"/>
<meta-data android:name="expo.modules.updates.EXPO_RELEASE_CHANNEL" android:value="${releaseChannel}"/>
<meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="WIFI_ONLY"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait" android:documentLaunchMode="never">
<intent-filter>

View File

@ -5,6 +5,10 @@ import 'dotenv/config'
const toootVersion = `${versions.major}.${versions.minor}.${versions.patch}`
export default (): ExpoConfig => ({
updates: {
url: "https://u.expo.dev/3288313f-3ff0-496a-a5a9-d8985e7cad5f"
},
runtimeVersion: `${versions.major}.${versions.minor}`,
name: 'tooot',
description: 'tooot for Mastodon',
slug: 'tooot',

View File

@ -31,8 +31,8 @@ private_lane :build_ios do
IPA_FILE = "#{BUILD_DIRECTORY}/tooot.ipa"
DSYM_FILE = "#{BUILD_DIRECTORY}/tooot.app.dSYM.zip"
set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesSDKVersion", value: VERSIONS[:expo] )
set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesReleaseChannel", value: RELEASE_CHANNEL )
set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesRuntimeVersion", value: VERSION )
set_info_plist_value( path: EXPO_PLIST, key: "EXUpdatesReleaseChannel", value: ENVIRONMENT )
setup_ci
set_info_plist_value( path: INFO_PLIST, key: "CFBundleShortVersionString", value: VERSION )
@ -97,8 +97,8 @@ private_lane :build_android do
print_command: true,
print_command_output: true,
properties: {
"expoSDK" => VERSIONS[:expo],
"releaseChannel" => RELEASE_CHANNEL,
"runtimeVersion" => VERSION,
"releaseChannel" => ENVIRONMENT,
"android.injected.signing.store.file" => "#{File.expand_path('..', Dir.pwd)}/android/tooot.jks",
"android.injected.signing.store.password" => ENV["ANDROID_KEYSTORE_PASSWORD"],
"android.injected.signing.key.alias" => ENV["ANDROID_KEYSTORE_ALIAS"],
@ -136,8 +136,8 @@ private_lane :build_android_apk do
print_command: true,
print_command_output: true,
properties: {
"expoSDK" => VERSIONS[:expo],
"releaseChannel" => RELEASE_CHANNEL,
"runtimeVersion" => VERSION,
"releaseChannel" => ENVIRONMENT,
"android.injected.signing.store.file" => "#{File.expand_path('..', Dir.pwd)}/android/tooot.jks",
"android.injected.signing.store.password" => ENV["ANDROID_KEYSTORE_PASSWORD"],
"android.injected.signing.key.alias" => ENV["ANDROID_KEYSTORE_ALIAS"],
@ -185,6 +185,5 @@ lane :release do
upload_assets: ["#{File.expand_path('..', Dir.pwd)}/tooot-#{GITHUB_RELEASE}.apk"]
)
end
yarn( package_path: "./package.json", flags: "release", command: RELEASE_CHANNEL )
rocket
end

View File

@ -9,10 +9,10 @@
<key>EXUpdatesLaunchWaitMs</key>
<integer>0</integer>
<key>EXUpdatesReleaseChannel</key>
<string>0-development</string>
<key>EXUpdatesSDKVersion</key>
<string>development</string>
<key>EXUpdatesRuntimeVersion</key>
<string>0</string>
<key>EXUpdatesURL</key>
<string>https://exp.host/@xmflsct/tooot</string>
<string>https://u.expo.dev/3288313f-3ff0-496a-a5a9-d8985e7cad5f</string>
</dict>
</plist>

View File

@ -1,11 +1,9 @@
{
"name": "tooot",
"versions": {
"native": "220806",
"major": 4,
"minor": 2,
"patch": 0,
"expo": "46.0.0"
"patch": 0
},
"description": "tooot app for Mastodon",
"author": "xmflsct <me@xmflsct.com>",
@ -20,7 +18,6 @@
"iphone": "react-native run-ios",
"ipad": "react-native run-ios --simulator 'iPad mini (6th generation)'",
"app:build": "bundle exec fastlane",
"release": "scripts/release.sh",
"clean": "react-native-clean-project",
"postinstall": "patch-package"
},
@ -149,4 +146,4 @@
}
}
}
}
}

View File

@ -1,8 +0,0 @@
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Arguments incorrect"
exit 1
fi
expo publish --quiet --target bare --release-channel=$1

View File

@ -23,13 +23,13 @@ const apiGeneral = async <T = unknown>({
}: Params): Promise<{ body: T }> => {
console.log(
ctx.bgGreen.bold(' API general ') +
' ' +
domain +
' ' +
method +
ctx.green(' -> ') +
`/${url}` +
(params ? ctx.green(' -> ') : ''),
' ' +
domain +
' ' +
method +
ctx.green(' -> ') +
`/${url}` +
(params ? ctx.green(' -> ') : ''),
params ? params : ''
)
@ -44,7 +44,7 @@ const apiGeneral = async <T = unknown>({
body && body instanceof FormData
? 'multipart/form-data'
: 'application/json',
'User-Agent': `tooot/${Constants.manifest?.version}`,
'User-Agent': `tooot/${Constants.expoConfig?.version}`,
Accept: '*/*',
...headers
},

View File

@ -74,7 +74,7 @@ const apiInstance = async <T = unknown>({
body && body instanceof FormData
? 'multipart/form-data'
: 'application/json',
'User-Agent': `tooot/${Constants.manifest?.version}`,
'User-Agent': `tooot/${Constants.expoConfig?.version}`,
Accept: '*/*',
...headers,
...(token && {

View File

@ -50,7 +50,7 @@ const apiTooot = async <T = unknown>({
body && body instanceof FormData
? 'multipart/form-data'
: 'application/json',
'User-Agent': `tooot/${Constants.manifest?.version}`,
'User-Agent': `tooot/${Constants.expoConfig?.version}`,
Accept: '*/*',
...headers
},

View File

@ -42,7 +42,7 @@ const SettingsAnalytics: React.FC = () => {
color: colors.secondary
}}
>
{t('me.settings.version', { version: Constants.manifest?.version })}
{t('me.settings.version', { version: Constants.expoConfig?.version })}
</CustomText>
<CustomText
fontStyle='S'

View File

@ -36,14 +36,14 @@ const mapEnvironment = <T = unknown>({
const isDevelopment =
__DEV__ ||
['development'].some(channel => Updates.releaseChannel.includes(channel))
['development'].some(channel => Updates.channel === channel)
const isCandidate = ['candidate'].some(channel =>
Updates.releaseChannel.includes(channel)
Updates.channel === channel
)
const isRelease = ['release'].some(channel =>
Updates.releaseChannel.includes(channel)
Updates.channel === channel
)
export { mapEnvironment, isDevelopment, isCandidate, isRelease }

View File

@ -54,9 +54,9 @@ const appSlice = createSlice({
}
})
.addCase(retriveVersionLatest.fulfilled, (state, action) => {
if (action.payload && Constants.manifest?.version) {
if (action.payload && Constants.expoConfig?.version) {
if (
parseFloat(action.payload) > parseFloat(Constants.manifest.version)
parseFloat(action.payload) > parseFloat(Constants.expoConfig?.version)
) {
state.versionUpdate = true
}

View File

@ -38,7 +38,7 @@ const contextsSlice = createSlice({
initialState: contextsInitialState as ContextsState,
reducers: {
updateStoreReview: (state, action: PayloadAction<1>) => {
if (Updates.releaseChannel.includes('release')) {
if (Updates.channel === 'release') {
state.storeReview.current = state.storeReview.current + action.payload
if (state.storeReview.current === state.storeReview.context) {
StoreReview?.isAvailableAsync().then(() =>