|
62 | 62 | exit 1 |
63 | 63 | fi |
64 | 64 |
|
65 | | - prepare-assets: |
66 | | - needs: test |
67 | | - runs-on: ubuntu-latest |
68 | | - if: github.event_name != 'pull_request' |
69 | | - strategy: |
70 | | - matrix: |
71 | | - arch: [x86_64, aarch64] |
72 | | - defaults: |
73 | | - run: |
74 | | - working-directory: ./backend |
75 | | - steps: |
76 | | - - name: Checkout code |
77 | | - uses: actions/checkout@v4 |
78 | | - with: |
79 | | - lfs: true |
80 | | - submodules: true |
81 | | - token: ${{ secrets.PRO_TOKEN }} |
82 | | - |
83 | | - - name: Get version |
84 | | - id: get_version |
85 | | - run: | |
86 | | - VERSION=${GITHUB_REF#refs/tags/} |
87 | | - echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT |
88 | | -
|
89 | | - - name: Get VSIX |
90 | | - run: | |
91 | | - mkdir -p assets/vsix |
92 | | - VERSION_NO_V=${{ steps.get_version.outputs.VERSION }} |
93 | | - VERSION_NO_V=${VERSION_NO_V#v} |
94 | | - wget -O assets/vsix/monkeycode-${VERSION_NO_V}.vsix https://release.baizhi.cloud/monkeycode/vsixs/monkeycode-${VERSION_NO_V}.vsix |
95 | | -
|
96 | | - - name: Get SGP for ${{ matrix.arch }} |
97 | | - run: | |
98 | | - mkdir -p assets/sgp |
99 | | - echo "Downloading SGP for architecture: ${{ matrix.arch }}" |
100 | | - wget -O assets/sgp/sgp https://baizhiyun.oss-cn-hangzhou.aliyuncs.com/prod/sgp/${{ matrix.arch }}/sgp |
101 | | - wget -O assets/sgp/sgp-rules https://baizhiyun.oss-cn-hangzhou.aliyuncs.com/prod/sgp/${{ matrix.arch }}/sgp-rules |
102 | | - chmod +x assets/sgp/sgp |
103 | | -
|
104 | | - - name: Upload assets for ${{ matrix.arch }} |
105 | | - uses: actions/upload-artifact@v4 |
106 | | - with: |
107 | | - name: assets-${{ matrix.arch }} |
108 | | - path: backend/assets/ |
109 | | - retention-days: 1 |
110 | | - |
111 | 65 | build: |
112 | | - needs: prepare-assets |
| 66 | + needs: test |
113 | 67 | runs-on: ubuntu-latest |
114 | 68 | if: github.event_name != 'pull_request' |
115 | 69 | defaults: |
@@ -151,17 +105,27 @@ jobs: |
151 | 105 | GIT_COMMIT=$(git rev-parse HEAD) |
152 | 106 | echo "GIT_COMMIT=${GIT_COMMIT}" >> $GITHUB_OUTPUT |
153 | 107 |
|
154 | | - - name: Download x86_64 assets |
155 | | - uses: actions/download-artifact@v4 |
156 | | - with: |
157 | | - name: assets-x86_64 |
158 | | - path: backend/assets-x86_64/ |
159 | | - |
160 | | - - name: Download aarch64 assets |
161 | | - uses: actions/download-artifact@v4 |
162 | | - with: |
163 | | - name: assets-aarch64 |
164 | | - path: backend/assets-aarch64/ |
| 108 | + - name: Prepare assets for all architectures |
| 109 | + run: | |
| 110 | + # 创建架构特定的目录 |
| 111 | + mkdir -p assets-x86_64/{vsix,sgp} |
| 112 | + mkdir -p assets-aarch64/{vsix,sgp} |
| 113 | + |
| 114 | + # 下载 VSIX (架构无关) |
| 115 | + VERSION_NO_V=${{ steps.get_version.outputs.VERSION }} |
| 116 | + VERSION_NO_V=${VERSION_NO_V#v} |
| 117 | + wget -O assets-x86_64/vsix/monkeycode-${VERSION_NO_V}.vsix https://release.baizhi.cloud/monkeycode/vsixs/monkeycode-${VERSION_NO_V}.vsix |
| 118 | + cp assets-x86_64/vsix/monkeycode-${VERSION_NO_V}.vsix assets-aarch64/vsix/ |
| 119 | + |
| 120 | + # 下载 x86_64 SGP |
| 121 | + wget -O assets-x86_64/sgp/sgp https://baizhiyun.oss-cn-hangzhou.aliyuncs.com/prod/sgp/x86_64/sgp |
| 122 | + wget -O assets-x86_64/sgp/sgp-rules https://baizhiyun.oss-cn-hangzhou.aliyuncs.com/prod/sgp/x86_64/sgp-rules |
| 123 | + chmod +x assets-x86_64/sgp/sgp |
| 124 | + |
| 125 | + # 下载 aarch64 SGP |
| 126 | + wget -O assets-arm64/sgp/sgp https://baizhiyun.oss-cn-hangzhou.aliyuncs.com/prod/sgp/aarch64/sgp |
| 127 | + wget -O assets-arm64/sgp/sgp-rules https://baizhiyun.oss-cn-hangzhou.aliyuncs.com/prod/sgp/aarch64/sgp-rules |
| 128 | + chmod +x assets-arm64/sgp/sgp |
165 | 129 |
|
166 | 130 | - name: Set up QEMU |
167 | 131 | uses: docker/setup-qemu-action@v3 |
|
0 commit comments