Skip to content

Commit

Permalink
feat: display runtime version and commit hash for Expo Go
Browse files Browse the repository at this point in the history
  • Loading branch information
IZUMI-Zu committed Dec 14, 2024
1 parent 44d2b11 commit 8b75f25
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 124 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"

- name: Install dependencies
run: npm install
Expand All @@ -93,9 +93,11 @@ jobs:
- name: Create preview
id: preview
uses: expo/expo-github-action/preview@v8
env:
EXPO_PUBLIC_COMMIT_HASH: ${{ steps.pr-details.outputs.head_sha }}
with:
comment: false
qr-target: 'expo-go'
qr-target: "expo-go"
github-token: ${{ secrets.GITHUB_TOKEN }}
command: eas update --auto --branch pr-${{ needs.check_permissions.outputs.pr_head_ref }}

Expand All @@ -104,7 +106,7 @@ jobs:
id: find_comment
with:
issue-number: ${{ needs.check_permissions.outputs.pr_number }}
comment-author: 'github-actions[bot]'
comment-author: "github-actions[bot]"
body-includes: Expo Preview

- name: Create or Update Comment
Expand Down
15 changes: 14 additions & 1 deletion SettingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {Avatar, Button, IconButton, List, Surface, Text, useTheme} from "react-n
import {ActionSheetProvider} from "@expo/react-native-action-sheet";
import * as Application from "expo-application";
import {useTranslation} from "react-i18next";
import Constants, {ExecutionEnvironment} from "expo-constants";

import CasdoorLoginPage, {CasdoorLogout} from "./CasdoorLoginPage";
import LoginMethodSelector from "./LoginMethodSelector";
Expand Down Expand Up @@ -106,10 +107,22 @@ const SettingPage = () => {

<List.Item
title={t("settings.Version")}
description={Application.nativeApplicationVersion}
description={
Constants.executionEnvironment === ExecutionEnvironment.Standalone
? Application.nativeApplicationVersion
: Constants.expoConfig?.version
}
left={props => <List.Icon {...props} icon="information" />}
/>

{process.env.CI && (
<List.Item
title={t("settings.Commit Hash")}
description={process.env.EXPO_PUBLIC_COMMIT_HASH || "N/A"}
left={props => <List.Icon {...props} icon="git" />}
/>
)}

</List.Section>
</Surface>

Expand Down
3 changes: 3 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"scheme": "casdoor-app",
"runtimeVersion": {
"policy": "appVersion"
},
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
Expand Down
119 changes: 1 addition & 118 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
"expo-sqlite": "~15.0.3",
"expo-status-bar": "~2.0.0",
"expo-system-ui": "~4.0.5",
"expo-updates": "~0.26.10",
"hi-base32": "^0.5.1",
"hotp-totp": "^1.0.6",
"i18next": "^23.16.5",
Expand All @@ -61,7 +60,8 @@
"react-native-web": "~0.19.13",
"react-native-webview": "13.12.5",
"totp-generator": "^0.0.14",
"zustand": "^4.5.4"
"zustand": "^4.5.4",
"expo-constants": "~17.0.3"
},
"verifyConditions": [
"semantic-release-expo",
Expand Down

0 comments on commit 8b75f25

Please sign in to comment.