11# 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
22# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33
4- name : Node.js CI
4+ name : Build Packages
55
66on :
77 release :
88 types : [published]
99 push :
1010 tags :
1111 - v*
12- branches : [ master, actions-dev ]
12+ branches : [ master, aur ]
1313 pull_request :
1414 branches : [ master ]
1515 # # Allows you to run this workflow manually from the Actions tab
1616 # workflow_dispatch:
1717
1818jobs :
1919 build :
20- name : Build
20+ name : Build tar.gz AppImage
2121 runs-on : ubuntu-latest
2222
2323 strategy :
4343 npm install node-gyp nw-gyp npm -g
4444 node-gyp install
4545
46- - id : Tag
46+ - name : Generate TAG
47+ id : Tag
4748 run : |
4849 tag='continuous'
4950 name='Continuous Build'
@@ -54,10 +55,13 @@ jobs:
5455 echo "tag result: $tag - $name"
5556 echo "::set-output name=tag::$tag"
5657 echo "::set-output name=name::$name"
57-
58+
5859 - name : Build
5960 run : |
6061 # docker-compose up
62+ export ACTION=true
63+ # tar.gz AppImage
64+ ls -l
6165 tools/setup-wechat-devtools-bash
6266 sudo chmod -R 755 package.nw
6367 bash tools/build-release.sh ${{ steps.tag.outputs.tag }} ${{ matrix.ARCH }}
@@ -78,15 +82,187 @@ jobs:
7882 run : |
7983 ls -l
8084
85+ - name : Upload artifact
86+ uses : actions/upload-artifact@v2.3.1
87+ with :
88+ # Artifact name
89+ name : wechat-devtools-${{ matrix.ARCH }}.build
90+ path : tmp/build
91+
92+ build-deb :
93+ name : Build Deb Package
94+ runs-on : ubuntu-latest
95+
96+ strategy :
97+ matrix :
98+ node-version : [16.x]
99+ ARCH : ['x86_64']
100+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
101+
102+ steps :
103+ - uses : actions/checkout@v2
104+ - name : Use Node.js ${{ matrix.node-version }}
105+ uses : actions/setup-node@v2
106+ with :
107+ node-version : ${{ matrix.node-version }}
108+ cache : ' npm'
109+
110+ - name : Prepare
111+ run : |
112+ pwd
113+ ls -l
114+ export ACTION_MODE=true
115+ sudo apt-get install -y libx11-dev libxkbfile-dev p7zip-full python2 python3 libkrb5-dev gcc openssl libssh2-1-dev g++ make
116+ npm install node-gyp nw-gyp npm -g
117+ node-gyp install
118+ # https://docs.makedeb.org/home/installing/apt-repository/
119+ wget -qO - 'https://proget.hunterwittenborn.com/debian-feeds/makedeb.pub' | \
120+ gpg --dearmor | \
121+ sudo tee /usr/share/keyrings/makedeb-archive-keyring.gpg &> /dev/null
122+ echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.hunterwittenborn.com/ makedeb main' | \
123+ sudo tee /etc/apt/sources.list.d/makedeb.list
124+ sudo apt update
125+ sudo apt-get install -y makedeb gconf2
126+
127+ - name : Generate TAG
128+ id : Tag
129+ run : |
130+ tag='continuous'
131+ name='Continuous Build'
132+ if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
133+ tag='${{ github.ref_name }}'
134+ name='${{ github.ref_name }}'
135+ fi
136+ echo "tag result: $tag - $name"
137+ echo "::set-output name=tag::$tag"
138+ echo "::set-output name=name::$name"
139+
140+ - name : Build Deb Package
141+ run : |
142+ tools/build-aur.sh deb
143+ # deb
144+ cd tmp/AUR
145+ makedeb
146+ cd ../
147+ # ./tmp
148+ ls -l AUR
149+ mkdir -p build
150+ mv AUR/*.deb build
151+ rm -rf AUR/pkg AUR/src
152+ ls -l build
153+
154+ - name : Upload artifact
155+ uses : actions/upload-artifact@v2.3.1
156+ with :
157+ # Artifact name
158+ name : wechat-devtools-${{ matrix.ARCH }}.build
159+ path : tmp/build
160+
161+ build-arch :
162+ name : Build ArchLinux Package
163+ runs-on : ubuntu-latest
164+ timeout-minutes : 30
165+ strategy :
166+ matrix :
167+ node-version : [16.x]
168+ ARCH : ['x86_64']
169+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
170+
171+ steps :
172+ - uses : actions/checkout@v2
173+ - name : Use Node.js ${{ matrix.node-version }}
174+ uses : actions/setup-node@v2
175+ with :
176+ node-version : ${{ matrix.node-version }}
177+ cache : ' npm'
178+
179+ - name : Prepare
180+ run : |
181+ npm install node-gyp nw-gyp npm -g
182+ node-gyp install
183+ cat /etc/passwd
184+
185+ - name : Generate TAG
186+ id : Tag
187+ run : |
188+ tag='continuous'
189+ name='Continuous Build'
190+ if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
191+ tag='${{ github.ref_name }}'
192+ name='${{ github.ref_name }}'
193+ fi
194+ echo "tag result: $tag - $name"
195+ echo "::set-output name=tag::$tag"
196+ echo "::set-output name=name::$name"
197+
198+ - name : Build ArchLinux Package
199+ uses : countstarlight/arch-makepkg-action@master
200+ with :
201+ repos : >
202+ archlinuxcn=https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
203+ before : " tools/build-aur.sh && sudo pacman -S --noconfirm archlinuxcn-keyring"
204+ packages : >
205+ gconf
206+ p7zip
207+ libxkbfile
208+ python2
209+ openssl
210+ gcc
211+ make
212+ libssh2
213+ krb5
214+ scripts : " cd tmp/AUR && makepkg && ls -l && cd ../../"
215+
216+ - name : Fix Permissions
217+ run : |
218+ sudo chmod -R 0777 tmp
219+ mkdir -p tmp/build
220+ mv tmp/AUR/*.pkg.* tmp/build
221+ cd tmp/build
222+ for file in `ls *.pkg.*`;do mv $file `echo $file|sed 's/:/-/g'`;done;
223+ ls -l
224+
225+ - name : Upload artifact
226+ uses : actions/upload-artifact@v2.3.1
227+ with :
228+ # Artifact name
229+ name : wechat-devtools-${{ matrix.ARCH }}.build
230+ path : tmp/build
231+
232+ upload :
233+ name : Create release and upload artifacts
234+ needs :
235+ - build
236+ - build-deb
237+ - build-arch
238+ runs-on : ubuntu-latest
239+ steps :
240+ - name : Download artifacts
241+ uses : actions/download-artifact@v2
242+ - name : Inspect directory after downloading artifacts
243+ run : ls -alFR
244+
245+ - name : Generate TAG
246+ id : Tag
247+ run : |
248+ tag='continuous'
249+ name='Continuous Build'
250+ if [ 'true' == ${{ startsWith(github.ref, 'refs/tags/') }} ];then
251+ tag='${{ github.ref_name }}'
252+ name='${{ github.ref_name }}'
253+ fi
254+ echo "tag result: $tag - $name"
255+ echo "::set-output name=tag::$tag"
256+ echo "::set-output name=name::$name"
257+
81258 - name : Create release and upload artifacts
82259 if : startsWith(github.ref, 'refs/heads/')
83260 env :
84261 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
85262 run : |
86- cd tmp/build
87263 wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
88264 chmod +x pyuploadtool-x86_64.AppImage
89- ./pyuploadtool-x86_64.AppImage WeChat*.AppImage *.tar.gz
265+ ./pyuploadtool-x86_64.AppImage **/ WeChat*.AppImage **/* .tar.gz **/*.deb **/*.pkg.*
90266
91267 - name : Release
92268 uses : softprops/action-gh-release@v1
97273 name : ${{ steps.tag.outputs.name }}
98274 tag_name : ${{ steps.tag.outputs.tag }}
99275 files : |
100- tmp/build/*.tar.gz
101- tmp/build/*.AppImage
276+ **/WeChat*.AppImage
277+ **/*.tar.gz
278+ **/*.deb
279+ **/*.pkg.*
0 commit comments