Compare commits
2
Commits
6895d98606
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1411aaeae | ||
|
|
557ace6150 |
@@ -1,5 +1,6 @@
|
|||||||
.git/
|
.git/
|
||||||
data/
|
data/
|
||||||
|
dist/
|
||||||
ufile
|
ufile
|
||||||
frontend/node_modules/
|
frontend/node_modules/
|
||||||
frontend/dist/
|
frontend/dist/
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
name: CLI Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: tencent-local
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build CLI binaries
|
|
||||||
run: ./scripts/build-cli.sh
|
|
||||||
|
|
||||||
- name: Verify checksums
|
|
||||||
run: cd dist && sha256sum -c checksums.txt
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: Release
|
name: Build and Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -12,6 +12,25 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build CLI artifact image
|
||||||
|
run: |
|
||||||
|
docker build \
|
||||||
|
--target cli-artifacts \
|
||||||
|
--build-arg GOPROXY=https://goproxy.cn,direct \
|
||||||
|
--build-arg VERSION=${{ github.sha }} \
|
||||||
|
--build-arg COMMIT=${{ github.sha }} \
|
||||||
|
-t ufile-cli-artifacts:latest .
|
||||||
|
|
||||||
|
- name: Extract CLI binaries
|
||||||
|
run: |
|
||||||
|
container="ufile-cli-artifacts-$$"
|
||||||
|
docker run -d --name "$container" ufile-cli-artifacts:latest
|
||||||
|
trap 'docker rm -f "$container" >/dev/null 2>&1 || true' EXIT
|
||||||
|
mkdir -p dist
|
||||||
|
docker cp "$container:/dist/." dist/
|
||||||
|
cd dist
|
||||||
|
sha256sum -c checksums.txt
|
||||||
|
|
||||||
- name: Build image
|
- name: Build image
|
||||||
run: docker build --build-arg GOPROXY=https://goproxy.cn,direct -t ufile:latest .
|
run: docker build --build-arg GOPROXY=https://goproxy.cn,direct -t ufile:latest .
|
||||||
|
|
||||||
|
|||||||
+19
@@ -18,6 +18,25 @@ COPY *.go ./
|
|||||||
COPY --from=frontend /src/frontend/dist ./frontend/dist
|
COPY --from=frontend /src/frontend/dist ./frontend/dist
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /ufile .
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /ufile .
|
||||||
|
|
||||||
|
FROM golang:1.24-alpine AS cli-builder
|
||||||
|
|
||||||
|
ARG GOPROXY=https://proxy.golang.org,direct
|
||||||
|
ARG VERSION=dev
|
||||||
|
ARG COMMIT=unknown
|
||||||
|
ENV GOPROXY=${GOPROXY}
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
|
COPY cmd/ufile-cli/ ./cmd/ufile-cli/
|
||||||
|
COPY scripts/build-cli.sh ./scripts/build-cli.sh
|
||||||
|
RUN VERSION="${VERSION}" COMMIT="${COMMIT}" ./scripts/build-cli.sh
|
||||||
|
|
||||||
|
FROM alpine:3.22 AS cli-artifacts
|
||||||
|
|
||||||
|
COPY --from=cli-builder /src/dist /dist
|
||||||
|
CMD ["sh", "-c", "while :; do sleep 3600; done"]
|
||||||
|
|
||||||
FROM alpine:3.22
|
FROM alpine:3.22
|
||||||
|
|
||||||
RUN addgroup -S -g 10001 ufile \
|
RUN addgroup -S -g 10001 ufile \
|
||||||
|
|||||||
Reference in New Issue
Block a user