mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-06-13 15:47:37 +08:00
Merge branch 'main' into feat/update-deps
This commit is contained in:
commit
e7f56dae83
3 changed files with 39 additions and 41 deletions
37
.github/workflows/build-dev.yml
vendored
37
.github/workflows/build-dev.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v6
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
run: |
|
run: |
|
||||||
if [ -f DEV-VERSION ]; then
|
if [ -f DEV-VERSION ]; then
|
||||||
|
|
@ -21,7 +21,7 @@ jobs:
|
||||||
echo "DEV-VERSION file not found!" && exit 1
|
echo "DEV-VERSION file not found!" && exit 1
|
||||||
fi
|
fi
|
||||||
- name: 输出版本号
|
- name: 输出版本号
|
||||||
run: |
|
run: |
|
||||||
echo "Version: ${{ env.VERSION }}"
|
echo "Version: ${{ env.VERSION }}"
|
||||||
- name: 预先创建Pre-release
|
- name: 预先创建Pre-release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
|
@ -46,10 +46,9 @@ jobs:
|
||||||
goarch: [amd64, arm64]
|
goarch: [amd64, arm64]
|
||||||
env:
|
env:
|
||||||
OUTPUT_BINARY: ghproxy
|
OUTPUT_BINARY: ghproxy
|
||||||
GO_VERSION: 1.25
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: dev
|
ref: dev
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
|
|
@ -63,11 +62,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
||||||
sudo rm -rf pages/.git/
|
sudo rm -rf pages/.git/
|
||||||
|
|
||||||
- name: 安装 Go
|
- name: 安装 Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version-file: go.mod
|
||||||
- name: 编译
|
- name: 编译
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
|
|
@ -83,7 +82,7 @@ jobs:
|
||||||
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
||||||
ls
|
ls
|
||||||
- name: 上传Artifact
|
- name: 上传Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
||||||
path: |
|
path: |
|
||||||
|
|
@ -100,8 +99,8 @@ jobs:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
body: ${{ env.VERSION }}
|
body: ${{ env.VERSION }}
|
||||||
env:
|
env:
|
||||||
export PATH: $PATH:/usr/local/go/bin
|
export PATH: $PATH:/usr/local/go/bin
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
needs: build
|
||||||
|
|
@ -109,10 +108,10 @@ jobs:
|
||||||
IMAGE_NAME: wjqserver/ghproxy
|
IMAGE_NAME: wjqserver/ghproxy
|
||||||
DOCKERFILE: docker/dockerfile/dev/Dockerfile
|
DOCKERFILE: docker/dockerfile/dev/Dockerfile
|
||||||
DOCKERFILE_PATH: docker/dockerfile/dev
|
DOCKERFILE_PATH: docker/dockerfile/dev
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: dev
|
ref: dev
|
||||||
- name: Load VERSION
|
- name: Load VERSION
|
||||||
|
|
@ -121,26 +120,26 @@ jobs:
|
||||||
echo "VERSION=$(cat DEV-VERSION)" >> $GITHUB_ENV
|
echo "VERSION=$(cat DEV-VERSION)" >> $GITHUB_ENV
|
||||||
else
|
else
|
||||||
echo "DEV-VERSION file not found!" && exit 1
|
echo "DEV-VERSION file not found!" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 构建镜像
|
- name: 构建镜像
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
file: ./${{ env.DOCKERFILE }}
|
file: ./${{ env.DOCKERFILE }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
||||||
${{ env.IMAGE_NAME }}:dev
|
${{ env.IMAGE_NAME }}:dev
|
||||||
|
|
|
||||||
41
.github/workflows/build.yml
vendored
41
.github/workflows/build.yml
vendored
|
|
@ -12,8 +12,8 @@ jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -23,7 +23,7 @@ jobs:
|
||||||
echo "VERSION file not found!" && exit 1
|
echo "VERSION file not found!" && exit 1
|
||||||
fi
|
fi
|
||||||
- name: 输出版本号
|
- name: 输出版本号
|
||||||
run: |
|
run: |
|
||||||
echo "Version: ${{ env.VERSION }}"
|
echo "Version: ${{ env.VERSION }}"
|
||||||
- name: 预先创建release
|
- name: 预先创建release
|
||||||
id: create_release
|
id: create_release
|
||||||
|
|
@ -40,17 +40,16 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: prepare # 确保这个作业在 prepare 作业完成后运行
|
needs: prepare
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
goos: [linux, darwin, freebsd]
|
goos: [linux, darwin, freebsd]
|
||||||
goarch: [amd64, arm64]
|
goarch: [amd64, arm64]
|
||||||
env:
|
env:
|
||||||
OUTPUT_BINARY: ghproxy
|
OUTPUT_BINARY: ghproxy
|
||||||
GO_VERSION: 1.25
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- name: 加载版本号
|
- name: 加载版本号
|
||||||
|
|
@ -64,11 +63,11 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
sudo git clone https://github.com/WJQSERVER-STUDIO/GHProxy-Frontend.git pages
|
||||||
sudo rm -rf pages/.git/
|
sudo rm -rf pages/.git/
|
||||||
|
|
||||||
- name: 安装 Go
|
- name: 安装 Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v6
|
||||||
with:
|
with:
|
||||||
go-version: ${{ env.GO_VERSION }}
|
go-version-file: go.mod
|
||||||
- name: 编译
|
- name: 编译
|
||||||
env:
|
env:
|
||||||
GOOS: ${{ matrix.goos }}
|
GOOS: ${{ matrix.goos }}
|
||||||
|
|
@ -83,11 +82,11 @@ jobs:
|
||||||
cp LICENSE ./ghproxyd/
|
cp LICENSE ./ghproxyd/
|
||||||
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
tar -czf ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}.tar.gz -C ghproxyd .
|
||||||
- name: 上传Artifact
|
- name: 上传Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
name: ${{ env.OUTPUT_BINARY }}-${{matrix.goos}}-${{matrix.goarch}}
|
||||||
path: |
|
path: |
|
||||||
./${{ 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
|
||||||
|
|
@ -103,14 +102,14 @@ jobs:
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build # 确保这个作业在 build 作业完成后运行
|
needs: build
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME: wjqserver/ghproxy # 定义镜像名称变量
|
IMAGE_NAME: wjqserver/ghproxy
|
||||||
DOCKERFILE: docker/dockerfile/release/Dockerfile # 定义 Dockerfile 路径变量
|
DOCKERFILE: docker/dockerfile/release/Dockerfile
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: main
|
||||||
- name: Load VERSION
|
- name: Load VERSION
|
||||||
|
|
@ -122,26 +121,26 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v4
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: 构建镜像
|
- name: 构建镜像
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v7
|
||||||
with:
|
with:
|
||||||
file: ./${{ env.DOCKERFILE }}
|
file: ./${{ env.DOCKERFILE }}
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
${{ env.IMAGE_NAME }}:${{ env.VERSION }}
|
||||||
${{ env.IMAGE_NAME }}:v4
|
${{ env.IMAGE_NAME }}:v4
|
||||||
${{ env.IMAGE_NAME }}:latest
|
${{ env.IMAGE_NAME }}:latest
|
||||||
wjqserver/ghproxy-touka:latest
|
wjqserver/ghproxy-touka:latest
|
||||||
wjqserver/ghproxy-touka:${{ env.VERSION }}
|
wjqserver/ghproxy-touka:${{ env.VERSION }}
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -10,7 +10,6 @@ require (
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.3
|
|
||||||
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2
|
github.com/WJQSERVER-STUDIO/go-utils/limitreader v0.0.2
|
||||||
github.com/WJQSERVER/wanf v0.0.8
|
github.com/WJQSERVER/wanf v0.0.8
|
||||||
github.com/fenthope/bauth v0.0.1
|
github.com/fenthope/bauth v0.0.1
|
||||||
|
|
@ -25,6 +24,7 @@ require (
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/WJQSERVER-STUDIO/go-utils/iox v0.0.3 // indirect
|
||||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
||||||
golang.org/x/text v0.36.0 // indirect
|
golang.org/x/text v0.36.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue