fix: fix ci

This commit is contained in:
sagitchu 2025-03-18 22:02:44 +08:00
parent 040c032b72
commit ffd7c36a6d

View File

@ -30,52 +30,31 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check repository URL
run: |
REPO_URL=$(git config --get remote.origin.url)
if [[ "$REPO_URL" == *"pro.git" ]]; then
echo "This repository is not allowed to build."
if [[ $REPO_URL == *"pro" ]]; then
exit 1
fi
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Build Frontend
env:
CI: ""
run: |
cd web
git describe --tags > VERSION
export REACT_APP_VERSION=$(git describe --tags)
chmod u+x ./build.sh
./build.sh
REACT_APP_VERSION=$(git describe --tags) chmod u+x ./build.sh && ./build.sh
cd ..
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '>=1.18.0'
- name: Build Backend (amd64)
run: |
VERSION=$(git describe --tags)
LDFLAGS="-s -w -X 'github.com/songquanpeng/one-api/common.Version=$VERSION' -extldflags '-static'"
go mod download
go build -ldflags "$LDFLAGS" -o one-api
- name: Build Backend (arm64)
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
VERSION=$(git describe --tags)
LDFLAGS="-s -w -X 'github.com/songquanpeng/one-api/common.Version=$VERSION' -extldflags '-static'"
CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build -ldflags "$LDFLAGS" -o one-api-arm64
go build -ldflags "-s -w -X 'github.com/songquanpeng/one-api/common.Version=test' -extldflags '-static'" -o one-api
commit_lint:
runs-on: ubuntu-latest