ZhaoShanGeng commited on
Commit ·
b11a2d8
1
Parent(s): d842c73
fix: 移除分支检查,所有分支都触发二进制构建
Browse files
.github/workflows/build-binaries.yml
CHANGED
|
@@ -2,7 +2,7 @@ name: Build Binaries
|
|
| 2 |
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
-
branches: [ '
|
| 6 |
workflow_dispatch:
|
| 7 |
inputs:
|
| 8 |
platforms:
|
|
@@ -120,7 +120,7 @@ jobs:
|
|
| 120 |
body: |
|
| 121 |
自动构建的二进制文件 (实验性)
|
| 122 |
|
| 123 |
-
分支: `
|
| 124 |
提交: ${{ github.sha }}
|
| 125 |
|
| 126 |
## 下载
|
|
|
|
| 2 |
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
+
branches: [ '**' ]
|
| 6 |
workflow_dispatch:
|
| 7 |
inputs:
|
| 8 |
platforms:
|
|
|
|
| 120 |
body: |
|
| 121 |
自动构建的二进制文件 (实验性)
|
| 122 |
|
| 123 |
+
分支: `${{ github.ref_name }}`
|
| 124 |
提交: ${{ github.sha }}
|
| 125 |
|
| 126 |
## 下载
|
.github/workflows/docker-publish.yml
CHANGED
|
@@ -2,10 +2,7 @@ name: Docker Build and Push
|
|
| 2 |
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
-
branches: [ '**' ]
|
| 6 |
-
tags: [ 'v*' ]
|
| 7 |
-
pull_request:
|
| 8 |
-
branches: [ main, master ]
|
| 9 |
workflow_dispatch:
|
| 10 |
|
| 11 |
env:
|
|
@@ -23,34 +20,20 @@ jobs:
|
|
| 23 |
- name: Checkout
|
| 24 |
uses: actions/checkout@v4
|
| 25 |
|
| 26 |
-
# 检查是否是 binary-build 分支
|
| 27 |
-
- name: Check if binary build branch
|
| 28 |
-
id: check_branch
|
| 29 |
-
run: |
|
| 30 |
-
if [[ "${{ github.ref }}" == "refs/heads/binary-build" ]] || [[ "${{ github.ref }}" == refs/heads/release/* ]]; then
|
| 31 |
-
echo "is_binary=true" >> $GITHUB_OUTPUT
|
| 32 |
-
else
|
| 33 |
-
echo "is_binary=false" >> $GITHUB_OUTPUT
|
| 34 |
-
fi
|
| 35 |
-
|
| 36 |
# 二进制构建:先编译再构建 Docker
|
| 37 |
-
- name: Setup Node.js
|
| 38 |
-
if: steps.check_branch.outputs.is_binary == 'true'
|
| 39 |
uses: actions/setup-node@v4
|
| 40 |
with:
|
| 41 |
node-version: '18'
|
| 42 |
cache: 'npm'
|
| 43 |
|
| 44 |
-
- name: Install dependencies
|
| 45 |
-
if: steps.check_branch.outputs.is_binary == 'true'
|
| 46 |
run: npm ci
|
| 47 |
|
| 48 |
- name: Build Linux binary
|
| 49 |
-
if: steps.check_branch.outputs.is_binary == 'true'
|
| 50 |
run: npm run build:linux
|
| 51 |
|
| 52 |
- name: List dist contents
|
| 53 |
-
if: steps.check_branch.outputs.is_binary == 'true'
|
| 54 |
run: |
|
| 55 |
echo "=== dist directory contents ==="
|
| 56 |
ls -la dist/
|
|
@@ -58,7 +41,6 @@ jobs:
|
|
| 58 |
ls -la dist/bin/ || echo "No bin directory"
|
| 59 |
|
| 60 |
- name: Set executable permissions
|
| 61 |
-
if: steps.check_branch.outputs.is_binary == 'true'
|
| 62 |
run: |
|
| 63 |
chmod +x dist/antigravity-linux-x64
|
| 64 |
chmod +x dist/bin/* || true
|
|
@@ -80,14 +62,9 @@ jobs:
|
|
| 80 |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
| 81 |
tags: |
|
| 82 |
type=ref,event=branch
|
| 83 |
-
type=
|
| 84 |
-
type=semver,pattern={{version}}
|
| 85 |
-
type=semver,pattern={{major}}.{{minor}}
|
| 86 |
-
type=raw,value=latest,enable={{is_default_branch}}
|
| 87 |
|
| 88 |
-
|
| 89 |
-
- name: Build and push (binary)
|
| 90 |
-
if: steps.check_branch.outputs.is_binary == 'true'
|
| 91 |
uses: docker/build-push-action@v5
|
| 92 |
with:
|
| 93 |
context: .
|
|
@@ -97,15 +74,3 @@ jobs:
|
|
| 97 |
labels: ${{ steps.meta.outputs.labels }}
|
| 98 |
cache-from: type=gha
|
| 99 |
cache-to: type=gha,mode=max
|
| 100 |
-
|
| 101 |
-
# 源码构建使用默认 Dockerfile
|
| 102 |
-
- name: Build and push (source)
|
| 103 |
-
if: steps.check_branch.outputs.is_binary != 'true'
|
| 104 |
-
uses: docker/build-push-action@v5
|
| 105 |
-
with:
|
| 106 |
-
context: .
|
| 107 |
-
push: true
|
| 108 |
-
tags: ${{ steps.meta.outputs.tags }}
|
| 109 |
-
labels: ${{ steps.meta.outputs.labels }}
|
| 110 |
-
cache-from: type=gha
|
| 111 |
-
cache-to: type=gha,mode=max
|
|
|
|
| 2 |
|
| 3 |
on:
|
| 4 |
push:
|
| 5 |
+
branches: [ '**' ]
|
|
|
|
|
|
|
|
|
|
| 6 |
workflow_dispatch:
|
| 7 |
|
| 8 |
env:
|
|
|
|
| 20 |
- name: Checkout
|
| 21 |
uses: actions/checkout@v4
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
# 二进制构建:先编译再构建 Docker
|
| 24 |
+
- name: Setup Node.js
|
|
|
|
| 25 |
uses: actions/setup-node@v4
|
| 26 |
with:
|
| 27 |
node-version: '18'
|
| 28 |
cache: 'npm'
|
| 29 |
|
| 30 |
+
- name: Install dependencies
|
|
|
|
| 31 |
run: npm ci
|
| 32 |
|
| 33 |
- name: Build Linux binary
|
|
|
|
| 34 |
run: npm run build:linux
|
| 35 |
|
| 36 |
- name: List dist contents
|
|
|
|
| 37 |
run: |
|
| 38 |
echo "=== dist directory contents ==="
|
| 39 |
ls -la dist/
|
|
|
|
| 41 |
ls -la dist/bin/ || echo "No bin directory"
|
| 42 |
|
| 43 |
- name: Set executable permissions
|
|
|
|
| 44 |
run: |
|
| 45 |
chmod +x dist/antigravity-linux-x64
|
| 46 |
chmod +x dist/bin/* || true
|
|
|
|
| 62 |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
| 63 |
tags: |
|
| 64 |
type=ref,event=branch
|
| 65 |
+
type=raw,value=binary,enable=true
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
+
- name: Build and push
|
|
|
|
|
|
|
| 68 |
uses: docker/build-push-action@v5
|
| 69 |
with:
|
| 70 |
context: .
|
|
|
|
| 74 |
labels: ${{ steps.meta.outputs.labels }}
|
| 75 |
cache-from: type=gha
|
| 76 |
cache-to: type=gha,mode=max
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|