mirror of
https://github.com/xtekky/gpt4free.git
synced 2026-04-22 15:47:11 +08:00
fix: pin 8 unpinned action(s),extract 2 unsafe expression(s) to env vars
This commit is contained in:
@@ -22,8 +22,8 @@ jobs:
|
|||||||
- name: Determine version
|
- name: Determine version
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.ref }}" =~ ^refs/tags/ ]]; then
|
if [[ "${GIT_REF}" =~ ^refs/tags/ ]]; then
|
||||||
G4F_VERSION="${{ github.ref_name }}"
|
G4F_VERSION="${REF_NAME}"
|
||||||
IS_RELEASE="true"
|
IS_RELEASE="true"
|
||||||
elif [[ -n "${{ inputs.version }}" ]]; then
|
elif [[ -n "${{ inputs.version }}" ]]; then
|
||||||
G4F_VERSION="${{ inputs.version }}"
|
G4F_VERSION="${{ inputs.version }}"
|
||||||
@@ -36,6 +36,9 @@ jobs:
|
|||||||
echo "is_release=${IS_RELEASE}" >> $GITHUB_OUTPUT
|
echo "is_release=${IS_RELEASE}" >> $GITHUB_OUTPUT
|
||||||
echo "Building version: ${G4F_VERSION}"
|
echo "Building version: ${G4F_VERSION}"
|
||||||
|
|
||||||
|
env:
|
||||||
|
GIT_REF: ${{ github.ref }}
|
||||||
|
REF_NAME: ${{ github.ref_name }}
|
||||||
# PyPI Package
|
# PyPI Package
|
||||||
build-pypi:
|
build-pypi:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -245,12 +248,12 @@ jobs:
|
|||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
|
||||||
- name: Get metadata for Docker
|
- name: Get metadata for Docker
|
||||||
id: metadata
|
id: metadata
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
hlohaus789/g4f
|
hlohaus789/g4f
|
||||||
@@ -260,7 +263,7 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Build and push armv7 image
|
- name: Build and push armv7 image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: docker/Dockerfile-armv7
|
file: docker/Dockerfile-armv7
|
||||||
@@ -273,7 +276,7 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
G4F_VERSION=${{ needs.prepare.outputs.version }}
|
G4F_VERSION=${{ needs.prepare.outputs.version }}
|
||||||
- name: Build and push slim images
|
- name: Build and push slim images
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: docker/Dockerfile-slim
|
file: docker/Dockerfile-slim
|
||||||
@@ -286,7 +289,7 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
G4F_VERSION=${{ needs.prepare.outputs.version }}
|
G4F_VERSION=${{ needs.prepare.outputs.version }}
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: docker/Dockerfile
|
file: docker/Dockerfile
|
||||||
@@ -426,7 +429,7 @@ jobs:
|
|||||||
echo "Downloaded artifacts:"
|
echo "Downloaded artifacts:"
|
||||||
find ./artifacts -type f -name "*" | sort
|
find ./artifacts -type f -name "*" | sort
|
||||||
- name: Create Release with Assets
|
- name: Create Release with Assets
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ needs.prepare.outputs.version }}
|
tag_name: ${{ needs.prepare.outputs.version }}
|
||||||
name: Release ${{ needs.prepare.outputs.version }}
|
name: Release ${{ needs.prepare.outputs.version }}
|
||||||
@@ -485,4 +488,4 @@ jobs:
|
|||||||
# name: pypi-package
|
# name: pypi-package
|
||||||
# path: dist/
|
# path: dist/
|
||||||
# - name: Publish to PyPI
|
# - name: Publish to PyPI
|
||||||
# uses: pypa/gh-action-pypi-publish@release/v1
|
# uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
|||||||
@@ -48,4 +48,4 @@ jobs:
|
|||||||
name: python-package-distributions
|
name: python-package-distributions
|
||||||
path: dist/
|
path: dist/
|
||||||
- name: Publish distribution 📦 to PyPI
|
- name: Publish distribution 📦 to PyPI
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
|
||||||
|
|||||||
Reference in New Issue
Block a user