mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 08:11:11 +08:00
24w13b
This commit is contained in:
parent
4eb9d1a899
commit
b57aa84bda
4 changed files with 41 additions and 10 deletions
19
.github/workflows/build-dev.yml
vendored
19
.github/workflows/build-dev.yml
vendored
|
|
@ -11,9 +11,13 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
goos: [linux]
|
||||||
|
goarch: [amd64, arm64]
|
||||||
env:
|
env:
|
||||||
OUTPUT_BINARY: ghproxy
|
OUTPUT_BINARY: ghproxy
|
||||||
OUTPUT_ARCHIVE: ghproxy.tar.gz
|
#OUTPUT_ARCHIVE: ghproxy.tar.gz
|
||||||
GO_VERSION: 1.23.2
|
GO_VERSION: 1.23.2
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -31,23 +35,22 @@ jobs:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version: ${{ env.GO_VERSION }}
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
CGO_ENABLED=0 go build -o ${{ env.OUTPUT_BINARY }} ./main.go
|
CGO_ENABLED=0 go build -o ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}} ./main.go
|
||||||
- name: Package
|
- name: Package
|
||||||
run: |
|
run: |
|
||||||
tar -czvf ${{ env.OUTPUT_ARCHIVE }} ./${{ env.OUTPUT_BINARY }}
|
tar -czvf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz ./${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
||||||
- name: Upload to GitHub Artifacts
|
- name: Upload to GitHub Artifacts
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ env.OUTPUT_BINARY }}
|
name: ${{ env.OUTPUT_BINARY }}
|
||||||
path: |
|
path: |
|
||||||
./${{ env.OUTPUT_ARCHIVE }}
|
./${{ env.OUTPUT_BINARY }}*
|
||||||
./${{ env.OUTPUT_BINARY }}
|
|
||||||
- name: 上传至Release
|
- name: 上传至Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ env.VERSION }}
|
name: ${{ env.VERSION }}
|
||||||
artifacts: ./${{ env.OUTPUT_ARCHIVE }}, ./${{ env.OUTPUT_BINARY }}
|
artifacts: ./${{ env.OUTPUT_BINARY }}*
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
tag: ${{ env.VERSION }}
|
tag: ${{ env.VERSION }}
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
|
|
@ -86,10 +89,10 @@ jobs:
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 构建镜像
|
- name: 构建镜像
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
file: ./${{ env.DOCKERFILE }}
|
file: ./${{ env.DOCKERFILE }}
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,12 @@
|
||||||
# 更新日志
|
# 更新日志
|
||||||
|
|
||||||
|
24w13b
|
||||||
|
---
|
||||||
|
- PRE-RELEASE: 此版本是v1.4.2的预发布版本,请勿在生产环境中使用
|
||||||
|
- CHANGE: 优化代码结构,提升性能
|
||||||
|
- CHANGE: 初步引入ARM64支持,但仍处于测试阶段
|
||||||
|
- CHANGE: 对Dockerfile进行优化,减少镜像体积
|
||||||
|
|
||||||
24w13a
|
24w13a
|
||||||
---
|
---
|
||||||
- PRE-RELEASE: 此版本是v1.4.2的预发布版本,请勿在生产环境中使用
|
- PRE-RELEASE: 此版本是v1.4.2的预发布版本,请勿在生产环境中使用
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
24w13a
|
24w13b
|
||||||
|
|
@ -1,14 +1,22 @@
|
||||||
FROM wjqserver/caddy:daily-alpine
|
FROM alpine:latest AS builder
|
||||||
|
|
||||||
ARG USER=WJQSERVER-STUDIO
|
ARG USER=WJQSERVER-STUDIO
|
||||||
ARG REPO=ghproxy
|
ARG REPO=ghproxy
|
||||||
ARG APPLICATION=ghproxy
|
ARG APPLICATION=ghproxy
|
||||||
|
|
||||||
|
# 创建文件夹
|
||||||
RUN mkdir -p /data/www
|
RUN mkdir -p /data/www
|
||||||
RUN mkdir -p /data/${APPLICATION}/config
|
RUN mkdir -p /data/${APPLICATION}/config
|
||||||
RUN mkdir -p /data/${APPLICATION}/log
|
RUN mkdir -p /data/${APPLICATION}/log
|
||||||
|
|
||||||
|
# 安装依赖
|
||||||
|
RUN apk add --no-cache curl wget
|
||||||
|
|
||||||
|
# 前端
|
||||||
RUN wget -O /data/www/index.html https://raw.githubusercontent.com/${USER}/${REPO}/main/pages/index.html
|
RUN wget -O /data/www/index.html https://raw.githubusercontent.com/${USER}/${REPO}/main/pages/index.html
|
||||||
RUN wget -O /data/www/favicon.ico https://raw.githubusercontent.com/${USER}/${REPO}/main/pages/favicon.ico
|
RUN wget -O /data/www/favicon.ico https://raw.githubusercontent.com/${USER}/${REPO}/main/pages/favicon.ico
|
||||||
|
|
||||||
|
# 后端
|
||||||
RUN wget -O /data/caddy/Caddyfile https://raw.githubusercontent.com/${USER}/${REPO}/main/caddyfile/release/Caddyfile
|
RUN wget -O /data/caddy/Caddyfile https://raw.githubusercontent.com/${USER}/${REPO}/main/caddyfile/release/Caddyfile
|
||||||
RUN VERSION=$(curl -s https://raw.githubusercontent.com/${USER}/${REPO}/main/DEV-VERSION) && \
|
RUN VERSION=$(curl -s https://raw.githubusercontent.com/${USER}/${REPO}/main/DEV-VERSION) && \
|
||||||
wget -O /data/${APPLICATION}/${APPLICATION} https://github.com/${USER}/${REPO}/releases/download/$VERSION/${APPLICATION}
|
wget -O /data/${APPLICATION}/${APPLICATION} https://github.com/${USER}/${REPO}/releases/download/$VERSION/${APPLICATION}
|
||||||
|
|
@ -16,6 +24,19 @@ RUN wget -O /data/${APPLICATION}/config.yaml https://raw.githubusercontent.com/$
|
||||||
RUN wget -O /data/${APPLICATION}/blacklist.json https://raw.githubusercontent.com/${USER}/${REPO}/main/config/blacklist.json
|
RUN wget -O /data/${APPLICATION}/blacklist.json https://raw.githubusercontent.com/${USER}/${REPO}/main/config/blacklist.json
|
||||||
RUN wget -O /data/${APPLICATION}/whitelist.json https://raw.githubusercontent.com/${USER}/${REPO}/main/config/whitelist.json
|
RUN wget -O /data/${APPLICATION}/whitelist.json https://raw.githubusercontent.com/${USER}/${REPO}/main/config/whitelist.json
|
||||||
RUN wget -O /usr/local/bin/init.sh https://raw.githubusercontent.com/${USER}/${REPO}/main/docker/dockerfile/dev/init.sh
|
RUN wget -O /usr/local/bin/init.sh https://raw.githubusercontent.com/${USER}/${REPO}/main/docker/dockerfile/dev/init.sh
|
||||||
|
|
||||||
|
# 权限
|
||||||
|
RUN chmod +x /data/${APPLICATION}/${APPLICATION}
|
||||||
|
RUN chmod +x /usr/local/bin/init.sh
|
||||||
|
|
||||||
|
FROM wjqserver/caddy:daily-alpine
|
||||||
|
|
||||||
|
COPY --from=builder /data/www /data/www
|
||||||
|
COPY --from=builder /data/caddy /data/caddy
|
||||||
|
COPY --from=builder /data/${APPLICATION} /data/${APPLICATION}
|
||||||
|
COPY --from=builder /usr/local/bin/init.sh /usr/local/bin/init.sh
|
||||||
|
|
||||||
|
# 权限
|
||||||
RUN chmod +x /data/${APPLICATION}/${APPLICATION}
|
RUN chmod +x /data/${APPLICATION}/${APPLICATION}
|
||||||
RUN chmod +x /usr/local/bin/init.sh
|
RUN chmod +x /usr/local/bin/init.sh
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue