Skip to content

Commit

Permalink
Merge pull request #46 from jumpserver/pr@dev@perf_support_win32
Browse files Browse the repository at this point in the history
perf: 支持 windows x86 架构
  • Loading branch information
fit2bot authored Oct 17, 2023
2 parents 5bf22e6 + 52b0cdc commit 6c2a04f
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Create Release And Upload assets

jobs:
create-realese:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Install Dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y build-essential wine wine32
- name: Checkout code
uses: actions/checkout@v2
- name: Get version
id: get_version
run: |
TAG=$(basename ${GITHUB_REF})
echo "::set-output name=TAG::$TAG"
- name: Create Release
id: create_release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
config-name: release-config.yml
version: ${{ steps.get_version.outputs.TAG }}
tag: ${{ steps.get_version.outputs.TAG }}
- uses: actions/setup-node@v3
with:
node-version: '16.20'
- name: Build Application
run: |
yarn install
yarn build
- name: Release Upload Assets
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
draft: true
files: |
build/*.exe
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM node:16.20-bullseye-slim as as stage-build
ARG TARGETARCH

ARG DEPENDENCIES=" \
build-essential \
ca-certificates \
icnsutils \
git \
git-lfs \
graphicsmagick \
wine \
wine32 \
xz-utils"

ARG APT_MIRROR=http://mirrors.ustc.edu.cn
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list \
&& rm -f /etc/apt/apt.conf.d/docker-clean \
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${DEPENDENCIES} \
&& echo "no" | dpkg-reconfigure dash

ARG NPM_REGISTRY="https://registry.npmmirror.com"
RUN set -ex \
&& npm config set registry ${NPM_REGISTRY} \
&& yarn config set registry ${NPM_REGISTRY}

WORKDIR /data

RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked \
--mount=type=bind,sources=package.json,target=/data/package.json \
yarn install

ADD . /data
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked \
yarn build

WORKDIR /data/build
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"scripts": {
"build": "node .electron-vue/build.js && electron-builder",
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
"build:win": "node .electron-vue/build.js && electron-builder --win --x64",
"build:win": "node .electron-vue/build.js && electron-builder --win",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"dev": "node .electron-vue/dev-runner.js",
Expand Down Expand Up @@ -62,7 +62,11 @@
"icon": "build/icons/player.ico",
"target": [
{
"target": "nsis"
"target": "nsis",
"arch": [
"x64",
"ia32"
]
}
]
},
Expand Down

0 comments on commit 6c2a04f

Please sign in to comment.