XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/gpt4free

Update build-packages.yml

d7ae0661
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

3 个文件 +47 -178
Modified .github/workflows/build-packages.yml +47 -24
@@ -165,7 +165,7 @@ jobs:
165 165 - name: Install dependencies
166 166 run: |
167 167 python -m pip install --upgrade pip
168 pip install -r requirements-min.txt
168 pip install -r requirements.txt
169 169 pip install pyinstaller
170 170 pip install -e .
171 171 - name: Build macOS executable
@@ -199,37 +199,60 @@ jobs:
199 199 needs: prepare
200 200 if: needs.prepare.outputs.is_release == 'true'
201 201 steps:
202 - uses: actions/checkout@v4
202 - name: Checkout repository
203 uses: actions/checkout@v4
203 204 - name: Set up QEMU
204 205 uses: docker/setup-qemu-action@v3
205 206 - name: Set up Docker Buildx
206 207 uses: docker/setup-buildx-action@v3
208 - name: Get metadata for Docker
209 id: metadata
210 uses: docker/metadata-action@v5
211 with:
212 images: |
213 hlohaus789/g4f
207 214 - name: Log in to Docker Hub
208 uses: docker/login-action@v3
215 uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
209 216 with:
210 217 username: ${{ secrets.DOCKER_USERNAME }}
211 218 password: ${{ secrets.DOCKER_PASSWORD }}
212 - name: Build and push Docker images
213 env:
214 G4F_VERSION: ${{ needs.prepare.outputs.version }}
215 run: |
216 # Build slim image for multiple platforms
217 docker buildx build \
218 --platform linux/amd64,linux/arm64 \
219 --file docker/Dockerfile-slim \
220 --tag hlohaus789/g4f:${{ needs.prepare.outputs.version }}-slim \
221 --tag hlohaus789/g4f:latest-slim \
222 --build-arg G4F_VERSION=${{ needs.prepare.outputs.version }} \
223 --push .
224
225 # Build full image for amd64
226 docker buildx build \
227 --platform linux/amd64 \
228 --file docker/Dockerfile \
229 --tag hlohaus789/g4f:${{ needs.prepare.outputs.version }} \
230 --tag hlohaus789/g4f:latest \
231 --build-arg G4F_VERSION=${{ needs.prepare.outputs.version }} \
232 --push .
219 - name: Build and push armv7 image
220 uses: docker/build-push-action@v5
221 with:
222 context: .
223 file: docker/Dockerfile-armv7
224 platforms: linux/arm/v7
225 push: true
226 tags: |
227 hlohaus789/g4f:latest-armv7
228 hlohaus789/g4f:${{ needs.prepare.outputs.version }}-armv7
229 labels: ${{ steps.metadata.outputs.labels }}
230 build-args: |
231 G4F_VERSION=${{ needs.prepare.outputs.version }}
232 - name: Build and push slim images
233 uses: docker/build-push-action@v5
234 with:
235 context: .
236 file: docker/Dockerfile-slim
237 platforms: linux/amd64,linux/arm64
238 push: true
239 tags: |
240 hlohaus789/g4f:latest-slim
241 hlohaus789/g4f:${{ needs.prepare.outputs.version }}-slim
242 labels: ${{ steps.metadata.outputs.labels }}
243 build-args: |
244 G4F_VERSION=${{ needs.prepare.outputs.version }}
245 - name: Build and push image
246 uses: docker/build-push-action@v5
247 with:
248 context: .
249 file: docker/Dockerfile
250 platforms: linux/amd64
251 push: true
252 tags: ${{ steps.metadata.outputs.tags }}
253 labels: ${{ steps.metadata.outputs.labels }}
254 build-args: |
255 G4F_VERSION=${{ needs.prepare.outputs.version }}
233 256
234 257 # WinGet Package Manifest
235 258 create-winget-manifest:
Deleted .github/workflows/publish-to-pypi.yml +0 -52
@@ -1,52 +0,0 @@
1 name: Publish Python 🐍 distribution 📦 to PyPI
2
3 on: push
4
5 env:
6 G4F_VERSION: ${{ github.ref_name }}
7
8 jobs:
9 build:
10 name: Build distribution 📦
11 if: github.repository == 'xtekky/gpt4free' && startsWith(github.ref, 'refs/tags/')
12 runs-on: ubuntu-latest
13 steps:
14 - uses: actions/checkout@v4
15 - name: Set up Python
16 uses: actions/setup-python@v4
17 with:
18 python-version: "3.x"
19 - name: Install pypa/build
20 run: >-
21 python3 -m
22 pip install
23 build
24 --user
25 - name: Build a binary wheel and a source tarball
26 run: python3 -m build
27 - name: Store the distribution packages
28 uses: actions/upload-artifact@v4
29 with:
30 name: python-package-distributions
31 path: dist/
32
33 publish-to-pypi:
34 name: >-
35 Publish distribution on PyPI 🐍
36 if: startsWith(github.ref, 'refs/tags/')
37 needs:
38 - build
39 runs-on: ubuntu-latest
40 environment:
41 name: pypi
42 url: https://pypi.org/p/g4f
43 permissions:
44 id-token: write
45 steps:
46 - name: Download all the dists
47 uses: actions/download-artifact@v4
48 with:
49 name: python-package-distributions
50 path: dist/
51 - name: Publish distribution 📦 to PyPI
52 uses: pypa/gh-action-pypi-publish@release/v1
Deleted .github/workflows/publish-workflow.yaml +0 -102
@@ -1,102 +0,0 @@
1 name: Publish Docker image
2
3 on:
4 push:
5 tags:
6 - '**'
7
8 jobs:
9 openapi:
10 runs-on: ubuntu-latest
11 steps:
12 - uses: actions/checkout@v4
13 - name: Set up Python 3.13
14 uses: actions/setup-python@v4
15 with:
16 python-version: "3.13"
17 cache: 'pip'
18 - name: Install requirements
19 run: |
20 pip install fastapi uvicorn python-multipart
21 pip install -r requirements-min.txt
22 - name: Generate openapi.json
23 run: |
24 python -m etc.tool.openapi
25 - uses: actions/upload-artifact@v4
26 with:
27 name: openapi
28 path: openapi.json
29 publish:
30 runs-on: ubuntu-latest
31 steps:
32 - name: Checkout repository
33 uses: actions/checkout@v4
34 - name: Set up QEMU
35 uses: docker/setup-qemu-action@v3
36 - name: Set up Docker Buildx
37 uses: docker/setup-buildx-action@v3
38
39 - name: Get metadata for Docker
40 id: metadata
41 uses: docker/metadata-action@v5
42 with:
43 images: |
44 hlohaus789/g4f
45
46 - name: Log in to Docker Hub
47 uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
48 with:
49 username: ${{ secrets.DOCKER_USERNAME }}
50 password: ${{ secrets.DOCKER_PASSWORD }}
51
52 - name: Build and push armv7 image
53 uses: docker/build-push-action@v5
54 with:
55 context: .
56 file: docker/Dockerfile-armv7
57 platforms: linux/arm/v7
58 push: true
59 tags: |
60 hlohaus789/g4f:latest-armv7
61 hlohaus789/g4f:${{ github.ref_name }}-armv7
62 labels: ${{ steps.metadata.outputs.labels }}
63 build-args: |
64 G4F_VERSION=${{ github.ref_name }}
65
66 - name: Build and push small images
67 uses: docker/build-push-action@v5
68 with:
69 context: .
70 file: docker/Dockerfile-slim
71 platforms: linux/amd64,linux/arm64
72 push: true
73 tags: |
74 hlohaus789/g4f:latest-slim
75 hlohaus789/g4f:${{ github.ref_name }}-slim
76 labels: ${{ steps.metadata.outputs.labels }}
77 build-args: |
78 G4F_VERSION=${{ github.ref_name }}
79
80 - name: Build and push arm64 image
81 uses: docker/build-push-action@v5
82 with:
83 context: .
84 file: docker/Dockerfile-slim
85 platforms: linux/arm64
86 push: true
87 tags: ${{ steps.metadata.outputs.tags }}
88 labels: ${{ steps.metadata.outputs.labels }}
89 build-args: |
90 G4F_VERSION=${{ github.ref_name }}
91
92 - name: Build and push big image
93 uses: docker/build-push-action@v5
94 with:
95 context: .
96 file: docker/Dockerfile
97 platforms: linux/amd64
98 push: true
99 tags: ${{ steps.metadata.outputs.tags }}
100 labels: ${{ steps.metadata.outputs.labels }}
101 build-args: |
102 G4F_VERSION=${{ github.ref_name }}