Skip to content

Commit b680c0a

Browse files
committed
Changed versioning approach.
1 parent 83021e2 commit b680c0a

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

.github/workflows/main-fe.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,11 @@ jobs:
3535
with:
3636
node-version: 20.x
3737

38-
39-
- name: 🔎 Identify Commit Hash
40-
id: commit
41-
uses: prompt/actions-commit-hash@v3
42-
43-
- name: 🔎 Identify version
44-
id: get_version
45-
uses: battila7/get-version-action@v2
46-
47-
- name: 🦸 change version in NPM
48-
uses: reedyuk/npm-version@1.2.2
49-
with:
50-
version: ${{ steps.get_version.outputs.version-without-v }}-${{ steps.commit.outputs.short }}
51-
package: "frontend/"
52-
git-tag-version: "false"
38+
- name: Set Version
39+
run: |
40+
VERSION=$(jq -r '.version' frontend/package.json)
41+
GIT_COMMIT=$(git rev-parse --short HEAD)
42+
echo "VITE_VER=${VERSION}-${GIT_COMMIT}" >> frontend/.env.production
5343
5444
- name: 📦 Build Site
5545
run: cd frontend && npm ci && npm run build:ion

frontend/.env.production

Whitespace-only changes.

frontend/src/modal/Settings.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
import { useQueryClient } from "@tanstack/react-query"
1818
import { useAuth } from "../hooks"
1919
import { formatBytes } from "../utils"
20-
import packageJson from "../../package.json"
2120

2221
interface Props {
2322
open: boolean
@@ -32,6 +31,7 @@ const Settings: React.FC<Props> = ({ open, hasUpdate, onClose, onSave }) => {
3231
const [newUsername, setNewUsername] = useState<string>(username ?? "")
3332
const [newPassword, setNewPassword] = useState<string>(token ?? "")
3433
const [storageInfo, setStorageInfo] = useState<{ usage: string; quota: string } | undefined>()
34+
const appVersion = import.meta.env.VITE_VER ?? "Unknown"
3535

3636
useEffect(() => {
3737
if ("storage" in navigator && "estimate" in navigator.storage) {
@@ -99,7 +99,7 @@ const Settings: React.FC<Props> = ({ open, hasUpdate, onClose, onSave }) => {
9999
<IonItem>
100100
<IonLabel>App Version</IonLabel>
101101
<IonLabel slot="end">
102-
{packageJson.version}
102+
{appVersion}
103103
{hasUpdate && (
104104
<IonButton
105105
onClick={handleUpdate}

0 commit comments

Comments
 (0)