Skip to content

Commit 0818a27

Browse files
authored
feat: 添加龙芯支持 (#17)
* refactor: remove docker compose * feat: 添加龙芯支持 * fix: 使用c++ 11 * fix: if判断 * fix: cache dir lost * fix: pnpm
1 parent 9b2702e commit 0818a27

File tree

11 files changed

+5011
-5312
lines changed

11 files changed

+5011
-5312
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
strategy:
2424
matrix:
25-
ARCH: ['x86_64']
25+
ARCH: ['x86_64', 'loong64']
2626
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2727

2828
steps:
@@ -45,8 +45,8 @@ jobs:
4545
name='${{ github.ref_name }}'
4646
fi
4747
echo "tag result: $tag - $name"
48-
echo "::set-output name=tag::$tag"
49-
echo "::set-output name=name::$name"
48+
echo "tag=$tag" >> $GITHUB_OUTPUT
49+
echo "name=$name" >> $GITHUB_OUTPUT
5050
5151
# - name: Configure the project
5252
# uses: threeal/cmake-action@v1.3.0
@@ -55,10 +55,32 @@ jobs:
5555
# run: cmake --build build
5656

5757
- name: Build the project
58+
if: matrix.ARCH == 'x86_64'
59+
run: |
60+
export DOCKER_UID=$UID
61+
export DOCKER_GID=$GID
62+
tools/build-with-docker.sh
63+
64+
- name: Use Node.js ${{ matrix.node-version }}
65+
if: matrix.ARCH == 'loong64'
66+
uses: actions/setup-node@v3
67+
with:
68+
# Version Spec of the version to use in SemVer notation.
69+
# It also emits such aliases as lts, latest, nightly and canary builds
70+
# Examples: 12.x, 10.15.1, >=10.15.0, lts/Hydrogen, 16-nightly, latest, node
71+
node-version: '22'
72+
check-latest: false
73+
- name: Prepare PNPM
74+
if: matrix.ARCH == 'loong64'
75+
run: |
76+
corepack enable
77+
pnpm install --no-frozen-lockfile
78+
- name: Build the project
79+
if: matrix.ARCH == 'loong64'
5880
run: |
5981
export DOCKER_UID=$UID
6082
export DOCKER_GID=$GID
61-
docker compose up
83+
tools/build-loong64.sh
6284
6385
- name: Upload prepare
6486
run: |
@@ -68,6 +90,10 @@ jobs:
6890
mkdir -p tmp/build
6991
mv build/{wcc,wcsc,wcc_module.node,wcsc_module.node} tmp/build
7092
cd tmp/build
93+
mv wcc wcc-${{ matrix.ARCH }}
94+
mv wcsc wcsc-${{ matrix.ARCH }}
95+
mv wcc_module.node wcc-${{ matrix.ARCH }}.node
96+
mv wcsc_module.node wcsc-${{ matrix.ARCH }}.node
7197
ls -l
7298
7399
- name: Upload artifact
@@ -123,10 +149,10 @@ jobs:
123149
corepack enable
124150
ls -l
125151
mkdir build
126-
cp **build/wcc build
127-
cp **build/wcsc build
128-
cp **build/wcc_module.node build
129-
cp **build/wcsc_module.node build
152+
cp **-${{ matrix.ARCH }}.build/wcc-${{ matrix.ARCH }} build/wcc
153+
cp **-${{ matrix.ARCH }}.build/wcsc-${{ matrix.ARCH }} build/wcsc
154+
cp **-${{ matrix.ARCH }}.build/wcc-${{ matrix.ARCH }}.node build/wcc_module.node
155+
cp **-${{ matrix.ARCH }}.build/wcsc-${{ matrix.ARCH }}.node build/wcsc_module.node
130156
chmod +x build/*
131157
ls -l build
132158
node -v
@@ -178,7 +204,7 @@ jobs:
178204
sudo apt install -y fuse
179205
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
180206
chmod +x pyuploadtool-x86_64.AppImage
181-
./pyuploadtool-x86_64.AppImage **build/wcc **build/wcsc **build/wcc_module.node **build/wcsc_module.node
207+
./pyuploadtool-x86_64.AppImage **build/wcc* **build/wcsc*
182208
183209
- name: Release
184210
uses: softprops/action-gh-release@v1
@@ -189,7 +215,5 @@ jobs:
189215
name: ${{ steps.tag.outputs.name }}
190216
tag_name: ${{ steps.tag.outputs.tag }}
191217
files: |
192-
**build/wcc
193-
**build/wcsc
194-
**build/wcc_module.node
195-
**build/wcsc_module.node
218+
**build/wcc*
219+
**build/wcsc*

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.0.0)
22
project(wx_complier VERSION 0.1.0 LANGUAGES C CXX)
33

4-
set(CMAKE_CXX_STANDARD 14)
4+
set(CMAKE_CXX_STANDARD 11)
55
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
66
set(TARGET_ARCH x64)
77
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_REENTRANT")
@@ -93,7 +93,6 @@ add_executable(test1
9393
# src/wxml/expr_lib/transit_table.cpp
9494
# )
9595

96-
include(CTest)
9796
enable_testing()
9897
add_test(transit_table_test
9998
$<TARGET_FILE:transit_table>

changelog.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 🌈 v0.1.6 / 2025-11-
2+
3+
🚀Features
4+
- 架构:添加龙芯支持
5+
6+
## 🌈 v0.1.5 / 2025-05-02
7+
8+
🚀Features
9+
10+
- Node模块:使用NAPI重写
11+
112
## 🌈 v0.1.4 / 2025-05-01
213

314
🐞 Bug Fixes

docker-compose.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)