Compare commits

...

12 Commits

Author SHA1 Message Date
Viktor Rådberg
7b0965c0dd test release 2024-01-13 19:40:36 +01:00
Viktor Rådberg
e55ea6a83a final test 2024-01-13 19:32:16 +01:00
Viktor Rådberg
481196de9b test 2024-01-13 19:30:42 +01:00
Viktor Rådberg
a136dbd3f9 test 2024-01-13 19:28:50 +01:00
Viktor Rådberg
8d23349dac test 2024-01-13 19:27:25 +01:00
Viktor Rådberg
a7caa46156 test 2024-01-13 19:22:31 +01:00
Viktor Rådberg
39cd3faae2 test 2024-01-13 19:19:30 +01:00
Viktor Rådberg
bdaa8e602f test 2024-01-13 19:18:45 +01:00
Viktor Rådberg
26490103a9 Merge pull request #30 from Vikeo/develop
test pr
2024-01-13 19:14:03 +01:00
Viktor Rådberg
56b07784d5 fix 2024-01-13 19:13:34 +01:00
Viktor Rådberg
4544c689a5 test 2024-01-13 19:12:11 +01:00
Viktor Rådberg
8a7a4b4127 test 2024-01-13 19:11:49 +01:00
3 changed files with 46 additions and 47 deletions

View File

@@ -1,59 +1,58 @@
name: Deploy to Firebase Hosting on merge
name: Deploy to Firebase Hosting
'on':
push:
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: Extract version from package.json
- name: Checkout repository
uses: actions/checkout@v3
- name: get version
id: version
run: echo "::set-output name=version::$(jq -r .version package.json)"
uses: notiz-dev/github-action-json-property@v0.2.0
with:
path: 'package.json'
prop_path: 'version'
- name: Create Release Note
id: create_release_note
run: echo "Release Note for version ${{ steps.version.outputs.version }}" > release_note.txt
# - name: Release
# uses: 'marvinpinto/action-automatic-releases@latest'
# with:
# repo_token: '${{ secrets.RELEASE_TOKEN }}'
# automatic_release_tag: 'latest'
# prerelease: true
# title: ${{ steps.version.outputs.version }}
# files: release_note.txt
run: echo "Release Note for version ${{ steps.version.outputs.prop }}" > release_note.txt
- name: Create Release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: 'path/to/artifact.tar.gz,another/path/to/artifact.txt' # Add your artifact paths
body: 'Release notes for version ${{ steps.version.outputs.version }}' # Customize your release notes
commit: ${{ github.sha }} # Use the commit hash of the current workflow run
tag: '${{ steps.version.outputs.version }}' # Specify the tag for the release
token: ${{ secrets.RELEASE_TOKEN }} # GitHub token for authentication
bodyFile: release_note.txt
commit: ${{ github.sha }}
tag: '${{ steps.version.outputs.prop }}'
token: ${{ secrets.RELEASE_TOKEN }}

View File

@@ -1,7 +1,7 @@
{
"name": "life-trinket",
"private": true,
"version": "0.5.1",
"version": "0.5.41",
"type": "commonjs",
"engines": {
"node": ">=18",

View File

@@ -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' }}