mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-22 00:00:04 +08:00
feat: appimage
This commit is contained in:
parent
e16c84007b
commit
1f61b3512e
116
.github/workflows/release.yml
vendored
116
.github/workflows/release.yml
vendored
@ -9,7 +9,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
branches: [ master, actions ]
|
branches: [ master, appimage ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
# # Allows you to run this workflow manually from the Actions tab
|
# # Allows you to run this workflow manually from the Actions tab
|
||||||
@ -17,51 +17,93 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [16.x]
|
node-version: [16.x]
|
||||||
|
ARCH: ['x86_64']
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v2
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
run: |
|
run: |
|
||||||
pwd
|
pwd
|
||||||
|
ls -l
|
||||||
|
export ACTION_MODE=true
|
||||||
|
npm uninstall node-gyp -g
|
||||||
|
npm install node-gyp nw-gyp npm -g
|
||||||
|
|
||||||
|
- id: tag
|
||||||
|
run: |
|
||||||
|
tag='continuous'
|
||||||
|
name='Continuous Build'
|
||||||
|
if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
|
||||||
|
tag='${{ github.ref_name }}'
|
||||||
|
name='${{ github.ref_name }}'
|
||||||
|
fi
|
||||||
|
echo "tag result: $tag - $name"
|
||||||
|
echo "::set-output name=tag::$tag"
|
||||||
|
echo "::set-output name=name::$name"
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: docker-compose up
|
||||||
|
|
||||||
|
- name: Build AppImage
|
||||||
|
run: |
|
||||||
|
sudo chmod -R 777 tmp package.nw node
|
||||||
|
bash tools/appimage.sh
|
||||||
|
wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
||||||
|
chmod a+x appimagetool-x86_64.AppImage
|
||||||
|
./appimagetool-x86_64.AppImage ./tmp/AppDir
|
||||||
|
env:
|
||||||
|
name: 'release-${{ github.ref_name }}'
|
||||||
|
ARCH: '${{ matrix.ARCH }}'
|
||||||
|
|
||||||
|
- name: Delete unused file
|
||||||
|
run: |
|
||||||
|
ls -l
|
||||||
|
sudo rm -rf cache tmp appimagetool-x86_64.AppImage
|
||||||
|
mkdir ${{ env. name }}
|
||||||
|
sudo find -maxdepth 1 -not -name ${{ env.name }} -not -name . -exec mv {} ${{ env.name }} \;
|
||||||
|
sudo cp -r "${{ env.name }}/package.nw/node_modules/nodegit" nodegit
|
||||||
|
sudo cp -r "${{ env.name }}/compiler" compiler
|
||||||
|
sudo mv ${{ env.name }}/WeChat*.AppImage .
|
||||||
|
ls -l
|
||||||
|
cd "${{ env.name }}"
|
||||||
|
env:
|
||||||
|
name: 'release-${{ github.ref_name }}'
|
||||||
|
|
||||||
|
- name: Compress
|
||||||
|
run: |
|
||||||
ls -l
|
ls -l
|
||||||
chmod 777 docker/entrypoint
|
tar -zvcf ${{ env.name }}.tar.gz ${{ env.name }}
|
||||||
chmod 777 tools/*
|
tar -zvcf compiler.tar.gz compiler
|
||||||
export ACTION_MODE=true
|
tar -zvcf nodegit.tar.gz nodegit
|
||||||
npm uninstall node-gyp -g
|
sudo rm -rf ${{ env.name }} compiler nodegit
|
||||||
npm install node-gyp nw-gyp npm -g
|
ls -l
|
||||||
|
env:
|
||||||
|
name: 'release-${{ github.ref_name }}'
|
||||||
|
|
||||||
- name: Build
|
- name: Release
|
||||||
run: docker-compose up
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
- name: Delete unused file
|
# note you'll typically need to create a personal access token
|
||||||
run: |
|
# with permissions to create releases in the other repo
|
||||||
sudo rm -rf cache tmp
|
name: ${{ steps.tag.outputs.name }}
|
||||||
mkdir ${{ env. name }}
|
tag_name: ${{ steps.tag.outputs.tag }}
|
||||||
sudo find -maxdepth 1 -not -name ${{ env.name }} -not -name . -exec mv {} ${{ env.name }} \;
|
files: |
|
||||||
sudo cp -r "${{ env.name }}/package.nw/node_modules/nodegit" nodegit
|
${{ env.name }}.tar.gz
|
||||||
sudo cp -r "${{ env.name }}/compiler" compiler
|
compiler.tar.gz
|
||||||
ls -ls
|
nodegit.tar.gz
|
||||||
env:
|
*.AppImage
|
||||||
name: 'release-${{ github.ref_name }}'
|
env:
|
||||||
|
name: 'release-${{ github.ref_name }}'
|
||||||
- name: Release
|
|
||||||
uses: fnkr/github-action-ghr@v1
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
env:
|
|
||||||
GHR_COMPRESS: xz
|
|
||||||
GHR_PATH: .
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,3 +10,5 @@ test/mini-ci
|
|||||||
crash-server
|
crash-server
|
||||||
build
|
build
|
||||||
*.snap
|
*.snap
|
||||||
|
*.AppImage
|
||||||
|
appimage-builder-cache
|
0
docker/entrypoint
Normal file → Executable file
0
docker/entrypoint
Normal file → Executable file
@ -5,6 +5,7 @@
|
|||||||
- [x] 导入项目
|
- [x] 导入项目
|
||||||
- [x] 创建项目
|
- [x] 创建项目
|
||||||
- [x] 打开项目
|
- [x] 打开项目
|
||||||
|
- [x] ADB (请自行安装ADB)
|
||||||
|
|
||||||
## 小程序基本功能
|
## 小程序基本功能
|
||||||
|
|
||||||
|
12
res/appimage.desktop
Normal file
12
res/appimage.desktop
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=WeChat Dev Tools
|
||||||
|
Name[zh_CN]=微信开发者工具
|
||||||
|
Comment=The development tools for wechat projects
|
||||||
|
Comment[zh_CN]=提供微信开发相关项目的开发IDE支持
|
||||||
|
Categories=Development;WebDevelopment;IDE;
|
||||||
|
Exec=bin/wechat-devtools
|
||||||
|
Icon=wechat-devtools
|
||||||
|
Type=Application
|
||||||
|
Terminal=false
|
||||||
|
StartupWMClass=wechat_devtools
|
||||||
|
Actions=
|
28
tools/appimage.sh
Normal file
28
tools/appimage.sh
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
export ARCH=x86_64
|
||||||
|
|
||||||
|
root_dir=$(cd `dirname $0`/.. && pwd -P)
|
||||||
|
tmp_dir="$root_dir/tmp"
|
||||||
|
app_dir="$root_dir/tmp/AppDir"
|
||||||
|
|
||||||
|
# Remove any previous build
|
||||||
|
rm -rf $app_dir
|
||||||
|
# Make usr and icons dirs
|
||||||
|
mkdir -p $app_dir/bin
|
||||||
|
mkdir -p $app_dir/usr/{src,bin}
|
||||||
|
mkdir -p $app_dir/usr/share/{metainfo,icons}
|
||||||
|
|
||||||
|
cp "$root_dir/bin/wechat-devtools" "$app_dir/bin/wechat-devtools"
|
||||||
|
cp "$root_dir/res/appimage.desktop" "$app_dir/wechat-devtools.desktop"
|
||||||
|
cp "$root_dir/res/icons/wechat-devtools.png" "$app_dir/wechat-devtools.png"
|
||||||
|
|
||||||
|
echo "#!/bin/bash" > "$app_dir/AppRun"
|
||||||
|
echo "exec bin/wechat-devtools" >> "$app_dir/AppRun"
|
||||||
|
chmod +x "$app_dir/AppRun"
|
||||||
|
|
||||||
|
cp -r "$root_dir/package.nw" "$app_dir/package.nw"
|
||||||
|
cp -r "$root_dir/nwjs" "$app_dir/nwjs"
|
||||||
|
rm -rf "$app_dir/nwjs/node" "$app_dir/nwjs/node.exe"
|
||||||
|
cp -r "$root_dir/node/bin/node" "$app_dir/nwjs/node"
|
||||||
|
cd "$app_dir/nwjs/" && ln -s "node" "node.exe"
|
||||||
|
cd "$app_dir"
|
0
tools/fix-wcc-wcsc
Normal file → Executable file
0
tools/fix-wcc-wcsc
Normal file → Executable file
0
tools/setup-wechat-devtools-bash
Normal file → Executable file
0
tools/setup-wechat-devtools-bash
Normal file → Executable file
Loading…
x
Reference in New Issue
Block a user