Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Coder
code-server
提交
741b834b
C
code-server
项目概览
镜像
/
Coder
/
code-server
2022-09-21 03:15:05同步失败
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
741b834b
编写于
8月 10, 2021
作者:
A
Akash Satheesan
提交者:
GitHub
8月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(ci): armv7 cross builds (#3892)
上级
fb117666
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
55 addition
and
19 deletion
+55
-19
.github/workflows/ci.yaml
.github/workflows/ci.yaml
+26
-15
ci/build/arch-override.json
ci/build/arch-override.json
+8
-0
ci/build/build-packages.sh
ci/build/build-packages.sh
+20
-3
ci/build/nfpm.yaml
ci/build/nfpm.yaml
+1
-1
未找到文件。
.github/workflows/ci.yaml
浏览文件 @
741b834b
...
...
@@ -234,23 +234,32 @@ jobs:
# It is not feasible to cross-compile with CentOS.
# Cross-compile notes: To compile native dependencies for arm64,
# we install the aarch64 cross toolchain and then set it as the default
# we install the aarch64
/armv7l
cross toolchain and then set it as the default
# compiler/linker/etc. with the AR/CC/CXX/LINK environment variables.
# qemu-user-static on ubuntu-16.04 currently doesn't run Node correctly,
# so we just build with "native"/x86_64 node, then download arm64 node
# and then put it in our release. We can't smoke test the
arm64
build this way,
# so we just build with "native"/x86_64 node, then download arm64
/armv7l
node
# and then put it in our release. We can't smoke test the
cross
build this way,
# but this means we don't need to maintain a self-hosted runner!
package-linux-
arm64
:
name
:
Linux
ARM64 cross-compile build
package-linux-
cross
:
name
:
Linux
cross-compile builds
needs
:
build
runs-on
:
ubuntu-16.04
timeout-minutes
:
15
strategy
:
matrix
:
include
:
-
prefix
:
aarch64-linux-gnu
arch
:
arm64
-
prefix
:
arm-linux-gnueabihf
arch
:
armv7l
env
:
AR
:
aarch64-linux-gnu-ar
CC
:
aarch64-linux-gnu-gcc
CXX
:
aarch64-linux-gnu-g++
LINK
:
aarch64-linux-gnu-g++
NPM_CONFIG_ARCH
:
arm64
AR
:
${{ format('{0}-ar', matrix.prefix) }}
CC
:
${{ format('{0}-gcc', matrix.prefix) }}
CXX
:
${{ format('{0}-g++', matrix.prefix) }}
LINK
:
${{ format('{0}-g++', matrix.prefix) }}
NPM_CONFIG_ARCH
:
${{ matrix.arch }}
NODE_VERSION
:
v14.17.4
steps
:
-
uses
:
actions/checkout@v2
...
...
@@ -266,7 +275,9 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
-
name
:
Install cross-compiler
run
:
sudo apt install g++-aarch64-linux-gnu
run
:
sudo apt install $PACKAGE
env
:
PACKAGE
:
${{ format('g++-{0}', matrix.prefix) }}
-
name
:
Download npm package
uses
:
actions/download-artifact@v2
...
...
@@ -279,14 +290,14 @@ jobs:
-
name
:
Build standalone release
run
:
yarn release:standalone
-
name
:
Replace node with
arm64
equivalent
-
name
:
Replace node with
cross-compile
equivalent
run
:
|
wget https://nodejs.org/dist/
v14.17.0/node-v14.17.0-linux-arm64
.tar.xz
tar -xf node-
v14.17.0-linux-arm64.tar.xz node-v14.17.0-linux-arm64
/bin/node --strip-components=2
wget https://nodejs.org/dist/
${NODE_VERSION}/node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}
.tar.xz
tar -xf node-
${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}
/bin/node --strip-components=2
mv ./node ./release-standalone/lib/node
-
name
:
Build packages with nfpm
run
:
yarn package
arm64
run
:
yarn package
${NPM_CONFIG_ARCH}
-
name
:
Upload release artifacts
uses
:
actions/upload-artifact@v2
...
...
ci/build/arch-override.json
0 → 100644
浏览文件 @
741b834b
{
"rpm"
:
{
"armv7l"
:
"armhfp"
},
"deb"
:
{
"armv7l"
:
"armhf"
}
}
ci/build/build-packages.sh
浏览文件 @
741b834b
...
...
@@ -43,14 +43,31 @@ release_gcp() {
cp
"./release-packages/
$release_name
.tar.gz"
"./release-gcp/latest/
$OS
-
$ARCH
.tar.gz"
}
# On some CPU architectures (notably node/uname "armv7l", default on Raspberry Pis),
# different package managers have different labels for the same CPU (deb=armhf, rpm=armhfp).
# This function parses arch-override.json and returns the overriden arch on platforms
# with alternate labels, or the same arch otherwise.
get_nfpm_arch
()
{
if
jq
-re
".
${
PKG_FORMAT
}
.
${
ARCH
}
"
./ci/build/arch-override.json
>
/dev/null
;
then
jq
-re
".
${
PKG_FORMAT
}
.
${
ARCH
}
"
./ci/build/arch-override.json
else
echo
"
$ARCH
"
fi
}
# Generates deb and rpm packages.
release_nfpm
()
{
local
nfpm_config
PKG_FORMAT
=
"deb"
NFPM_ARCH
=
"
$(
get_nfpm_arch
)
"
nfpm_config
=
"
$(
envsubst < ./ci/build/nfpm.yaml
)
"
nfpm pkg
-f
<
(
echo
"
$nfpm_config
"
)
--target
"release-packages/code-server_
${
VERSION
}
_
${
NFPM_ARCH
}
.deb"
# The underscores are convention for .deb.
nfpm pkg
-f
<
(
echo
"
$nfpm_config
"
)
--target
"release-packages/code-server_
${
VERSION
}
_
$ARCH
.deb"
nfpm pkg
-f
<
(
echo
"
$nfpm_config
"
)
--target
"release-packages/code-server-
$VERSION
-
$ARCH
.rpm"
PKG_FORMAT
=
"rpm"
NFPM_ARCH
=
"
$(
get_nfpm_arch
)
"
nfpm_config
=
"
$(
envsubst < ./ci/build/nfpm.yaml
)
"
nfpm pkg
-f
<
(
echo
"
$nfpm_config
"
)
--target
"release-packages/code-server-
$VERSION
-
$NFPM_ARCH
.rpm"
}
main
"
$@
"
ci/build/nfpm.yaml
浏览文件 @
741b834b
name
:
"
code-server"
arch
:
"
${ARCH}"
arch
:
"
${
NFPM_
ARCH}"
platform
:
"
linux"
version
:
"
v${VERSION}"
section
:
"
devel"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录