Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,61 @@ on:
release:
types: [ published ]

env:
TARGET_BRANCH: develop

jobs:
update-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: develop
ref: ${{ env.TARGET_BRANCH }}

- name: Update version in package.json
run: |
npm version ${{ github.event.release.tag_name }}

- name: Commit updated package.json
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ env.TARGET_BRANCH }}
commit_message: Update version in package.json
file_pattern: package.json

- name: Update Changelog
- name: Update version in backend/config.py
run: |
sed -i "s/API_DOCS_VERSION = '.*'/API_DOCS_VERSION = '${{ github.event.release.tag_name }}'/g" backend/config.py

- name: Commit updated backend/config.py
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ env.TARGET_BRANCH }}
commit_message: Update version in backend/config.py
file_pattern: backend/config.py

- name: Update changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
- name: Commit updated changelog
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: Update CHANGELOG
branch: ${{ env.TARGET_BRANCH }}
commit_message: Update changelog
file_pattern: CHANGELOG.md

- name: Move tag to current commit
run: |
git tag -f ${{ github.event.release.tag_name }}

- name: Push changes
run: |
git push origin ${{ env.TARGET_BRANCH }}
git push origin ${{ github.event.release.tag_name }}

- name: "Send webhook to Discord"
uses: sarisia/actions-status-discord@v1
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ui/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function Markdown({content}: MarkdownProps) {
return (
<ReactMarkdown
remarkPlugins={[remarkGfm]}
className="prose dark:prose-invert max-w-none"
className="prose dark:prose-invert max-w-none prose-sm"
>
{content}
</ReactMarkdown>
Expand Down
10 changes: 0 additions & 10 deletions frontend/src/lib/date.ts

This file was deleted.

41 changes: 41 additions & 0 deletions frontend/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
import i18n from '@/i18n';
import { formatDistanceToNow } from 'date-fns';
import { enUS, sv, nb } from 'date-fns/locale';
import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"

// Class name utilities
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}

// String utilities
export function slugify(text: string): string {
return text
.toLowerCase()
.replace(/[^\w\s-]/g, '') // Remove special characters
.replace(/\s+/g, '-') // Replace spaces with hyphens
.replace(/-+/g, '-') // Replace multiple hyphens with single hyphen
.trim(); // Trim whitespace
}

// Date utilities
const getDateLocale = (language: string) => {
switch (language) {
case 'sv': return sv;
case 'no': return nb;
default: return enUS;
}
};

export const formatRelativeTime = (date: Date | string, language: string = i18n.language) => {
return formatDistanceToNow(new Date(date), {
addSuffix: true,
locale: getDateLocale(language)
});
};

export function formatDate(dateString: string): string {
const date = new Date(dateString);
return new Intl.DateTimeFormat(i18n.language, {
year: 'numeric',
month: 'short',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
}).format(date);
}
18 changes: 0 additions & 18 deletions frontend/src/lib/utils/date.ts

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/src/pages/changelog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function ChangelogPage() {
<Card key={release.id}>
<CardHeader>
<div className="flex items-center justify-between">
<CardTitle className="text-xl">
<CardTitle className="text-2xl">
{release.name || release.tag_name}
</CardTitle>
<div className="flex items-center gap-3">
Expand Down
Loading