workflow: pass version arg to builder

This commit is contained in:
2025-10-19 03:23:43 +11:00
parent dac4760289
commit ed479b7efa
3 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ builds:
pre: pre:
- cmd: npm install - cmd: npm install
dir: server/frontend dir: server/frontend
- cmd: APP_VERSION={{ .Version }} npm run build - cmd: VITE_APP_VERSION={{ .Version }} npm run build
dir: server/frontend dir: server/frontend
archives: archives:
- formats: ["tar.gz"] - formats: ["tar.gz"]

View File

@@ -4,7 +4,7 @@ COPY server/frontend/package*.json ./
RUN npm install RUN npm install
COPY server/frontend . COPY server/frontend .
ARG version ARG version
RUN APP_VERSION=${version} npm run build RUN VITE_APP_VERSION=${version} npm run build
FROM golang:1.25 as builder FROM golang:1.25 as builder
LABEL authors="nite07" LABEL authors="nite07"

View File

@@ -698,7 +698,7 @@ export class Sub2clashApp extends LitElement {
>sub2clash</a >sub2clash</a
> >
</p> </p>
<p>Version: ${import.meta.env.APP_VERSION ?? "dev"}</p> <p>Version: ${import.meta.env.VITE_APP_VERSION ?? "dev"}</p>
</aside> </aside>
</footer> </footer>
`; `;