Skip to content

Commit cab9cb8

Browse files
authored
refactor: 分离ci文件 (#142)
1 parent 99b2a42 commit cab9cb8

File tree

4 files changed

+226
-190
lines changed

4 files changed

+226
-190
lines changed

.github/workflows/build-deb.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Build DEB Package
5+
6+
on:
7+
workflow_dispatch:
8+
workflow_call:
9+
10+
jobs:
11+
build-deb:
12+
name: Build DEB Package
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
ARCH: ['x86_64']
18+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Download artifacts
23+
uses: actions/download-artifact@v4
24+
25+
- name: Generate TAG
26+
id: Tag
27+
run: |
28+
tag='continuous'
29+
name='Continuous Build'
30+
if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
31+
tag='${{ github.ref_name }}'
32+
name='${{ github.ref_name }}'
33+
fi
34+
echo "tag result: $tag - $name"
35+
echo "::set-output name=tag::$tag"
36+
echo "::set-output name=name::$name"
37+
# https://stackoverflow.com/questions/61096521/how-to-use-gpg-key-in-github-actions
38+
# gpg --generate-key
39+
# gpg --export-secret-keys YOUR_ID_HERE | base64 > private.key
40+
- name: Configure GPG Key
41+
run: |
42+
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
43+
gpg --list-secret-keys [email protected]
44+
env:
45+
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
46+
47+
- name: Prepare
48+
run: |
49+
sudo apt-get install -y build-essential fakeroot devscripts debhelper # debmake lintian pbuilder
50+
51+
- name: Build Deb Package
52+
run: |
53+
export BUILD_VERSION=${{ steps.tag.outputs.tag }}
54+
ls -l
55+
mkdir -p tmp/build
56+
export WINE=false
57+
tools/build-prepare.sh
58+
env WINE=false tools/build-deepin.sh ${{ steps.tag.outputs.tag }}
59+
60+
- name: Upload artifact
61+
uses: actions/upload-artifact@v4
62+
with:
63+
# Artifact name
64+
name: wechat-devtools-deb-${{ matrix.ARCH }}.build
65+
path: tmp/build

.github/workflows/build-src.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Build Base Packages
5+
6+
on:
7+
workflow_dispatch:
8+
workflow_call:
9+
10+
jobs:
11+
build-src:
12+
name: Build Base Packages
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [16.x]
18+
ARCH: ['x86_64']
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
submodules: 'recursive'
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v2
27+
28+
- name: Prepare
29+
run: |
30+
echo "$UID, $GID"
31+
32+
- name: Generate TAG
33+
id: Tag
34+
run: |
35+
tag='continuous'
36+
name='Continuous Build'
37+
if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
38+
tag='${{ github.ref_name }}'
39+
name='${{ github.ref_name }}'
40+
fi
41+
echo "tag result: $tag - $name"
42+
echo "::set-output name=tag::$tag"
43+
echo "::set-output name=name::$name"
44+
45+
- name: Build
46+
run: |
47+
export ACTION_MODE=true
48+
ls -l
49+
export WINE=false
50+
tools/build-with-docker.sh
51+
52+
- name: Compress Resources
53+
run: |
54+
ls -l
55+
mkdir -p tmp/src
56+
rm -rf nwjs/node nwjs/node.exe
57+
cp node/bin/node nwjs/node
58+
cd nwjs && ln -s node node.exe
59+
cd ..
60+
tar -zcf tmp/src/src-linux.tar.gz bin nwjs package.nw tools
61+
62+
- name: Compress nodegit
63+
run: |
64+
ls -l
65+
mkdir -p tmp/build
66+
cp -r package.nw/node_modules/nodegit .
67+
tar -zcf nodegit.tar.gz nodegit
68+
mv nodegit.tar.gz tmp/build
69+
cd tmp/build
70+
ls -l
71+
72+
- name: View Directory
73+
run: |
74+
ls -l
75+
76+
- name: Upload src artifact
77+
uses: actions/upload-artifact@v4
78+
with:
79+
# Artifact name
80+
name: wechat-devtools-${{ matrix.ARCH }}.src
81+
path: tmp/src
82+
83+
- name: Upload build artifact
84+
uses: actions/upload-artifact@v4
85+
with:
86+
# Artifact name
87+
name: wechat-devtools-${{ matrix.ARCH }}.build
88+
path: tmp/build

.github/workflows/build-tar.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Build tar.gz AppImage
5+
6+
on:
7+
workflow_dispatch:
8+
workflow_call:
9+
10+
jobs:
11+
build-tar:
12+
name: Build tar.gz AppImage
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [16.x]
18+
ARCH: ['x86_64']
19+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Download artifacts
24+
uses: actions/download-artifact@v4
25+
- name: Inspect directory after downloading artifacts
26+
run: |
27+
ls -alFR wechat-devtools-*.build
28+
ls -alFR wechat-devtools-*.src
29+
- name: Prepare
30+
run: |
31+
sudo apt install -y fuse
32+
echo "$UID, $GID"
33+
34+
- name: Generate TAG
35+
id: Tag
36+
run: |
37+
tag='continuous'
38+
name='Continuous Build'
39+
if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
40+
tag='${{ github.ref_name }}'
41+
name='${{ github.ref_name }}'
42+
fi
43+
echo "tag result: $tag - $name"
44+
echo "::set-output name=tag::$tag"
45+
echo "::set-output name=name::$name"
46+
47+
- name: Build
48+
run: |
49+
export WINE=false
50+
export ACTION_MODE=true
51+
# tar.gz AppImage
52+
ls -l
53+
mkdir -p tmp/build
54+
tools/build-prepare.sh
55+
tools/build-release.sh ${{ matrix.ARCH }} ${{ steps.tag.outputs.tag }}
56+
57+
- name: View Directory
58+
run: |
59+
ls -l
60+
61+
- name: Upload artifact
62+
uses: actions/upload-artifact@v4
63+
with:
64+
# Artifact name
65+
name: wechat-devtools-simple-${{ matrix.ARCH }}.build
66+
path: tmp/build

0 commit comments

Comments
 (0)