Skip to content

Commit

Permalink
chore: 修改编译脚本 (#26)
Browse files Browse the repository at this point in the history
* chore: 修改编译脚本

* chore: 添加 universal mac,修改 CI 脚本

* docs: 修改 README

* chore: 去掉 arm 架构编译脚本

* fix: 升级脚本

* chore: 修改dockerfile
  • Loading branch information
nashaofu committed Apr 19, 2023
1 parent 492f10a commit 629f8ae
Show file tree
Hide file tree
Showing 24 changed files with 1,224 additions and 1,007 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
16 changes: 8 additions & 8 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# Setup environment variables
ENV DEBIAN_FRONTEND=noninteractive \
DISPLAY=":0" \
VNC_PORT="5900" \
NOVNC_PORT="6080" \
DISPLAY_WIDTH="1280" \
DISPLAY_HEIGHT="720"
DISPLAY=":0" \
VNC_PORT="5900" \
NOVNC_PORT="6080" \
DISPLAY_WIDTH="1280" \
DISPLAY_HEIGHT="720"

COPY build.sh /tmp/build.sh
COPY docker-init.sh /usr/local/share/docker-init.sh

RUN bash /tmp/build.sh && \
rm /tmp/build.sh && \
chmod +x /usr/local/share/docker-init.sh
rm /tmp/build.sh && \
chmod +x /usr/local/share/docker-init.sh

ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
ENTRYPOINT [ "/usr/local/share/docker-init.sh" ]
14 changes: 7 additions & 7 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ export DEBIAN_FRONTEND=noninteractive
# Install noVNC X11 packages
apt-get update
apt-get -y install --no-install-recommends \
xvfb \
fluxbox \
x11vnc \
novnc \
libxcb1-dev \
libxrandr-dev \
libdbus-1-dev
xvfb \
fluxbox \
x11vnc \
novnc \
libxcb1-dev \
libxrandr-dev \
libdbus-1-dev

# Configure noVNC
cp /usr/share/novnc/vnc.html /usr/share/novnc/index.html
Expand Down
22 changes: 11 additions & 11 deletions .devcontainer/docker-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ DISPLAY_HEIGHT="${DISPLAY_HEIGHT:-720}"

# 后台运行程序
startInBackgroundIfNotRunning() {
echo "Starting $1."
if ! pidof $1 >/dev/null; then
$@ &
while ! pidof $1 >/dev/null; do
echo "Waiting $1 start"
sleep 1
done
echo "$1 started."
else
echo "$1 is already running."
fi
echo "Starting $1."
if ! pidof $1 >/dev/null; then
$@ &
while ! pidof $1 >/dev/null; do
echo "Waiting $1 start"
sleep 1
done
echo "$1 started."
else
echo "$1 is already running."
fi
}

startInBackgroundIfNotRunning Xvfb ${DISPLAY} -screen 0 ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT}x24 -dpi 96 -listen tcp -ac
Expand Down
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
13 changes: 8 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ name: docker-publish
on:
workflow_dispatch: # 手动触发
push:
branches: ['master']
branches: ["master"]
# Publish semver tags as releases.
tags: ['v*.*.*']
tags: ["v*.*.*"]
pull_request:
branches: ['master']
branches: ["master"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
# Use docker.io for Docker Hub if empty
Expand All @@ -20,7 +24,7 @@ jobs:
matrix:
platform:
- alpine
- slim
- debian
node:
- 14
- 16
Expand Down Expand Up @@ -59,4 +63,3 @@ jobs:
build-args: |
VERSION=${{ matrix.node }}
tags: ${{ env.REGISTRY }}/${{ github.repository }}/node-desktop:${{ matrix.node }}-${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
Loading

0 comments on commit 629f8ae

Please sign in to comment.