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
14 changes: 13 additions & 1 deletion .github/workflows/aio-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Read application version
id: version
run: |
VERSION="$(tr -d '[:space:]' < VERSION)"
if [ -z "$VERSION" ]; then
echo "VERSION file is empty" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Set up Bun
uses: oven-sh/setup-bun@v1

Expand Down Expand Up @@ -41,4 +51,6 @@ jobs:
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ secrets.DOCKER_USERNAME }}/dashwise:aio-preview
tags: |
${{ secrets.DOCKER_USERNAME }}/dashwise:aio-preview
${{ secrets.DOCKER_USERNAME }}/dashwise:${{ steps.version.outputs.version }}
12 changes: 11 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Read application version
id: version
run: |
VERSION="$(tr -d '[:space:]' < VERSION)"
if [ -z "$VERSION" ]; then
echo "VERSION file is empty" >&2
exit 1
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -33,7 +43,7 @@ jobs:
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ secrets.DOCKER_USERNAME }}/dashwise:${{ secrets.VERSION }}
${{ secrets.DOCKER_USERNAME }}/dashwise:${{ steps.version.outputs.version }}
${{ secrets.DOCKER_USERNAME }}/dashwise:latest
${{ secrets.DOCKER_USERNAME }}/dashwise:stable

1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ COPY --from=build /app/packages/api-types/package.json /app/packages/api-types/p
COPY --from=build /app/packages/types/package.json /app/packages/types/package.json
COPY --from=build /app/pocketbase/migrations /app/pocketbase/migrations
COPY --from=build /app/packages /app/packages
COPY --from=build /app/VERSION /app/VERSION

RUN bun install --production --frozen-lockfile

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v1.0-rc1
6 changes: 5 additions & 1 deletion apps/backend/src/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { readFileSync } from "node:fs";

const env = Bun.env;

const dashwiseVersion = readFileSync(new URL("../../../../VERSION", import.meta.url), "utf8").trim();

const processAllowSsl = env.ALLOW_SSL;
const processEnvironment = env.ENVIRONMENT;
const processStartPocketBase = env.START_POCKETBASE;
Expand Down Expand Up @@ -67,7 +71,7 @@ export const config = {
PB_ADMIN_PASSWORD: env.PB_ADMIN_PASSWORD,
DASHWISE_URL: env.DASHWISE_URL || (processEnvironment === "dev" ? "http://localhost:3000" : ""),
APP_BASE_URL: getEnv("APP_BASE_URL", "NEXT_PUBLIC_APP_URL") || env.DASHWISE_URL || (processEnvironment === "dev" ? "http://localhost:3000" : ""),
DASHWISE_VERSION: 'v1.0-alpha1',
DASHWISE_VERSION: dashwiseVersion || "development",
GITHUB_REPO: 'andreasmolnardev/dashwise-next',
INSTANCE_NAME: getEnv("INSTANCE_NAME", "NEXT_PUBLIC_INSTANCE_NAME") || "Dashwise",
DISABLE_USER_SIGNUP: truthyEnv(getEnv("DISABLE_USER_SIGNUP", "NEXT_PUBLIC_DISABLE_USER_SIGNUP")),
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const config: Config = {

default_bg_url: env.NEXT_PUBLIC_DEFAULT_BG_URL || "/dashboard-wallpaper.png",

version: "v1.0-alpha2",
version: env.NEXT_PUBLIC_VERSION || "development",

allowInsecureCertsForIntegrationUrls: allowInsecureCertsForIntegrationUrls || false,
enableSSO: enableSSOLogin,
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ interface ImportMetaEnv {
readonly NEXT_PUBLIC_PB_URL?: string;
readonly NEXT_PUBLIC_JOBS_URL?: string;
readonly NEXT_PUBLIC_DEFAULT_BG_URL?: string;
readonly NEXT_PUBLIC_VERSION?: string;
readonly NEXT_PUBLIC_INTEGRATIONS_ENABLE_SSL?: string;
readonly NEXT_PUBLIC_ENABLE_SSO?: string;
readonly NEXT_PUBLIC_DISABLE_USER_SIGNUP?: string;
readonly NEXT_PUBLIC_JOBS_WEBHOOK_ENABLE?: string;
readonly PB_ADMIN_EMAIL?: string;
readonly PB_ADMIN_PASSWORD?: string;
}
}
10 changes: 10 additions & 0 deletions apps/web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { readFileSync } from "node:fs";
import path from "path";

const version = readFileSync(path.resolve(__dirname, "../../VERSION"), "utf8").trim();

if (!version) {
throw new Error("VERSION file is empty");
}

export default defineConfig({
envPrefix: ["VITE_", "NEXT_PUBLIC_"],
define: {
"import.meta.env.NEXT_PUBLIC_VERSION": JSON.stringify(version),
},
plugins: [react()],
resolve: {
alias: {
Expand Down
Loading