返回提交历史
Modified
.github/workflows/build-packages.yml
+24
-20
Added
.github/workflows/publish-to-pypi.yml
+51
-0
XFEstudio/gpt4free
Update build-packages.yml
8fef9b16
代码差异
2 个文件
+75
-20
@@ -105,7 +105,7 @@ jobs:
105
105
- name: Zip Windows executable folder
106
106
shell: pwsh
107
107
run: |
108
Compress-Archive "dist\g4f-windows-${{ needs.prepare.outputs.version }}" "dist\g4f-windows-${{ needs.prepare.outputs.version }}.zip"
108
Compress-Archive "dist\g4f-windows-${{ needs.prepare.outputs.version }}" "dist\g4f-windows-${{ needs.prepare.outputs.version }}_x64.zip"
109
109
- name: Upload Windows zip archive
110
110
uses: actions/upload-artifact@v4
111
111
with:
@@ -329,7 +329,11 @@ jobs:
329
329
Installers:
330
330
- Architecture: x64
331
331
InstallerType: zip
332
InstallerUrl: https://github.com/xtekky/gpt4free/releases/download/${{ needs.prepare.outputs.version }}/g4f-windows-${{ needs.prepare.outputs.version }}.zip
332
NestedInstallerType: portable
333
NestedInstallerFiles:
334
- RelativeFilePath: g4f-windows-${{ needs.prepare.outputs.version }}/g4f-windows-${{ needs.prepare.outputs.version }}.exe
335
PortableCommandAlias: g4f
336
InstallerUrl: https://github.com/xtekky/gpt4free/releases/download/${{ needs.prepare.outputs.version }}/g4f-windows-${{ needs.prepare.outputs.version }}_x64.zip
333
337
InstallerSha256: ${{ steps.hash.outputs.hash }}
334
338
ManifestType: installer
335
339
ManifestVersion: 1.4.0
@@ -395,7 +399,7 @@ jobs:
395
399
- PyPI: `pip install g4f==${{ needs.prepare.outputs.version }}`
396
400
397
401
**Executables:**
398
- Windows: Download `g4f-windows-${{ needs.prepare.outputs.version }}.zip`
402
- Windows: Download `g4f-windows-${{ needs.prepare.outputs.version }}_x64.zip`
399
403
- Linux: Download `g4f-linux-${{ needs.prepare.outputs.version }}`
400
404
- macOS: Download `g4f-macos-${{ needs.prepare.outputs.version }}`
401
405
@@ -418,20 +422,20 @@ jobs:
418
422
token: ${{ secrets.GITHUB_TOKEN }}
419
423
420
424
# Publish to PyPI (only for releases)
421
publish-pypi:
422
runs-on: ubuntu-latest
423
needs: [prepare, build-pypi, create-release]
424
if: needs.prepare.outputs.is_release == 'true'
425
environment:
426
name: pypi
427
url: https://pypi.org/p/g4f
428
permissions:
429
id-token: write
430
steps:
431
- name: Download PyPI artifacts
432
uses: actions/download-artifact@v4
433
with:
434
name: pypi-package
435
path: dist/
436
- name: Publish to PyPI
437
uses: pypa/gh-action-pypi-publish@release/v1
425
# publish-pypi:
426
# runs-on: ubuntu-latest
427
# needs: [prepare, build-pypi, create-release]
428
# if: needs.prepare.outputs.is_release == 'true'
429
# environment:
430
# name: pypi
431
# url: https://pypi.org/p/g4f
432
# permissions:
433
# id-token: write
434
# steps:
435
# - name: Download PyPI artifacts
436
# uses: actions/download-artifact@v4
437
# with:
438
# name: pypi-package
439
# path: dist/
440
# - name: Publish to PyPI
441
# uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,51 @@
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
needs:
37
- build
38
runs-on: ubuntu-latest
39
environment:
40
name: pypi
41
url: https://pypi.org/p/g4f
42
permissions:
43
id-token: write
44
steps:
45
- name: Download all the dists
46
uses: actions/download-artifact@v4
47
with:
48
name: python-package-distributions
49
path: dist/
50
- name: Publish distribution 📦 to PyPI
51
uses: pypa/gh-action-pypi-publish@release/v1