forked from external-repos/LifeTrinket
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8f0788b97 | ||
|
|
bfe25eacb7 | ||
|
|
7b0965c0dd | ||
|
|
e55ea6a83a | ||
|
|
481196de9b | ||
|
|
a136dbd3f9 | ||
|
|
8d23349dac |
52
.github/workflows/firebase-release.yml
vendored
52
.github/workflows/firebase-release.yml
vendored
@@ -4,37 +4,43 @@ name: Deploy to Firebase Hosting
|
||||
tags:
|
||||
- '*'
|
||||
jobs:
|
||||
# build_and_deploy:
|
||||
# runs-on: ubuntu-latest
|
||||
# env:
|
||||
# REPO_READ_ACCESS_TOKEN: ${{ secrets.REPO_READ_ACCESS_TOKEN }}
|
||||
# steps:
|
||||
# - name: Checkout repository
|
||||
# uses: actions/checkout@v3
|
||||
build_and_deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
REPO_READ_ACCESS_TOKEN: ${{ secrets.REPO_READ_ACCESS_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# - name: Setup bun
|
||||
# uses: oven-sh/setup-bun@v1
|
||||
- name: Setup bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
|
||||
# - name: Build, lint, and deploy
|
||||
# run: |
|
||||
# bun install
|
||||
# bun run build
|
||||
# bun run lint
|
||||
# - name: Deploy to Firebase Hosting
|
||||
# uses: FirebaseExtended/action-hosting-deploy@v0
|
||||
# with:
|
||||
# repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
||||
# firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_LIFE_TRINKET }}'
|
||||
# channelId: live
|
||||
# projectId: life-trinket
|
||||
- name: Build, lint, and deploy
|
||||
run: |
|
||||
bun install
|
||||
bun run build
|
||||
bun run lint
|
||||
- name: Deploy to Firebase Hosting
|
||||
uses: FirebaseExtended/action-hosting-deploy@v0
|
||||
with:
|
||||
repoToken: '${{ secrets.GITHUB_TOKEN }}'
|
||||
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_LIFE_TRINKET }}'
|
||||
channelId: live
|
||||
projectId: life-trinket
|
||||
|
||||
release:
|
||||
# needs: build_and_deploy
|
||||
needs: build_and_deploy
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
working-directory: ${{ github.workspace }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: get version
|
||||
id: version
|
||||
uses: notiz-dev/github-action-json-property@v0.2.0
|
||||
|
||||
with:
|
||||
path: 'package.json'
|
||||
prop_path: 'version'
|
||||
@@ -46,7 +52,7 @@ jobs:
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1.13.0
|
||||
with:
|
||||
body: release_note.txt
|
||||
bodyFile: release_note.txt
|
||||
commit: ${{ github.sha }}
|
||||
tag: '${{ steps.version.outputs.prop }}'
|
||||
token: ${{ secrets.RELEASE_TOKEN }}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "life-trinket",
|
||||
"private": true,
|
||||
"version": "0.5.2",
|
||||
"version": "0.5.42",
|
||||
"type": "commonjs",
|
||||
"engines": {
|
||||
"node": ">=18",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useGlobalSettings } from '../../Hooks/useGlobalSettings';
|
||||
import { ModalWrapper } from './InfoModal';
|
||||
import { Separator } from './Separator';
|
||||
import { Paragraph } from './TextComponents';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const SettingContainer = twc.div`w-full flex flex-col`;
|
||||
|
||||
@@ -22,7 +22,7 @@ type SettingsModalProps = {
|
||||
export const SettingsModal = ({ isOpen, closeModal }: SettingsModalProps) => {
|
||||
const { settings, setSettings, isPWA } = useGlobalSettings();
|
||||
const [isLatestVersion, setIsLatestVersion] = useState(false);
|
||||
const newVersion = useRef<string | undefined>(undefined);
|
||||
const [newVersion, setNewVersion] = useState<string | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen) {
|
||||
@@ -45,13 +45,13 @@ export const SettingsModal = ({ isOpen, closeModal }: SettingsModalProps) => {
|
||||
|
||||
if (!data.name) {
|
||||
setIsLatestVersion(false);
|
||||
newVersion.current = undefined;
|
||||
setNewVersion(undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
/* @ts-expect-error is defined in vite.config.ts*/
|
||||
if (data.name === APP_VERSION) {
|
||||
newVersion.current = data.name;
|
||||
setNewVersion(data.name);
|
||||
setIsLatestVersion(true);
|
||||
return;
|
||||
}
|
||||
@@ -147,13 +147,13 @@ export const SettingsModal = ({ isOpen, closeModal }: SettingsModalProps) => {
|
||||
<span className="text-sm text-text-secondary">(latest)</span>
|
||||
)}
|
||||
</Paragraph>
|
||||
{!isLatestVersion && newVersion.current && (
|
||||
{!isLatestVersion && newVersion && (
|
||||
<Paragraph className="text-text-secondary text-lg text-center">
|
||||
New version ({newVersion.current}) is available!{' '}
|
||||
New version ({newVersion}) is available!{' '}
|
||||
</Paragraph>
|
||||
)}
|
||||
</SettingContainer>
|
||||
{!isLatestVersion && newVersion.current && (
|
||||
{!isLatestVersion && newVersion && (
|
||||
<Button
|
||||
variant="contained"
|
||||
style={{ marginTop: '0.25rem', marginBottom: '0.25rem' }}
|
||||
|
||||
Reference in New Issue
Block a user