mirror of
https://github.com/bestnite/sub2clash.git
synced 2025-10-25 16:51:01 +00:00
workflow
This commit is contained in:
2
.github/workflows/docker.yml
vendored
2
.github/workflows/docker.yml
vendored
@@ -52,6 +52,6 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
platforms: linux/amd64,linux/arm64
|
||||
file: Containerfile
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
version: 2
|
||||
project_name: sub2clash
|
||||
before:
|
||||
hooks:
|
||||
- bash ./build-frontend.sh {{ .Version }}
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
@@ -10,19 +13,10 @@ builds:
|
||||
goarch:
|
||||
- amd64
|
||||
- arm64
|
||||
- "386"
|
||||
ldflags:
|
||||
- -s -w -X github.com/bestnite/sub2clash/constant.Version={{ .Version }}
|
||||
flags:
|
||||
- -trimpath
|
||||
hooks:
|
||||
pre:
|
||||
- cmd: npm install
|
||||
dir: server/frontend
|
||||
- cmd: npm run build
|
||||
dir: server/frontend
|
||||
env:
|
||||
- VITE_APP_VERSION={{ .Version }}
|
||||
archives:
|
||||
- formats: ["tar.gz"]
|
||||
format_overrides:
|
||||
@@ -35,9 +29,9 @@ archives:
|
||||
- templates
|
||||
release:
|
||||
draft: true
|
||||
upx:
|
||||
- enabled: true
|
||||
compress: best
|
||||
# upx:
|
||||
# - enabled: true
|
||||
# compress: best
|
||||
nfpms:
|
||||
- id: sub2clash
|
||||
homepage: https://github.com/bestnite/sub2clash
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:lts-alpine as frontend_builder
|
||||
FROM node:latest AS frontend_builder
|
||||
WORKDIR /app/server/frontend
|
||||
COPY server/frontend/package*.json ./
|
||||
RUN npm install
|
||||
@@ -7,8 +7,7 @@ ARG version
|
||||
ENV VITE_APP_VERSION=${version}
|
||||
RUN npm run build
|
||||
|
||||
FROM golang:1.25 as builder
|
||||
LABEL authors="nite07"
|
||||
FROM golang:1.25 AS builder
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
COPY --from=frontend_builder /app/server/frontend/dist /app/server/frontend/dist
|
||||
|
||||
7
build-frontend.sh
Normal file
7
build-frontend.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
export VITE_APP_VERSION=$1
|
||||
|
||||
cd server/frontend
|
||||
npm install
|
||||
npm run build
|
||||
Reference in New Issue
Block a user