@@ -3,8 +3,6 @@ name: Build
33on :
44 push :
55 pull_request :
6- # schedule:
7- # - cron: '0 */2 * * *'
86
97jobs :
108 build-linux :
@@ -13,12 +11,12 @@ jobs:
1311 env :
1412 OS_NAME : unknown
1513 ARCH_NAME : unknown
16- DLL_NAME : libasyncprocess.so
14+ LIB_NAME : libasyncprocess.a
1715 RESULT_NAME : result-linux
1816 RESULT_PATH : result-linux
1917 RESULT_PATH_SUB : result-async/static
2018 steps :
21- - uses : actions/checkout@v2
19+ - uses : actions/checkout@v4
2220 - name : Set environment variables
2321 run : |
2422 pwd
@@ -34,16 +32,23 @@ jobs:
3432 - name : Build
3533 run : |
3634 gcc -v
37- rm static/$ARCH_NAME/$OS_NAME/$DLL_NAME
38- ./bootstrap
35+ # Generate build system
36+ libtoolize --copy --force --quiet
37+ aclocal
38+ autoheader
39+ automake --add-missing --copy --foreign
40+ autoconf
41+ # Configure for static build
42+ ./configure --enable-static --disable-shared LDFLAGS="-static"
43+ make
3944 - name : Copy Result
4045 if : always()
4146 run : |
4247 mkdir -p $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
43- cp static/$ARCH_NAME/$OS_NAME/$DLL_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
48+ cp .libs/$LIB_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME/
4449 - name : Upload Result
4550 if : always()
46- uses : actions/upload-artifact@v1
51+ uses : actions/upload-artifact@v4
4752 with :
4853 name : ${{ env.RESULT_NAME }}
4954 path : ${{ env.RESULT_PATH }}
@@ -54,18 +59,18 @@ jobs:
5459 env :
5560 OS_NAME : Linux
5661 ARCH_NAME : aarch64
57- DLL_NAME : libasyncprocess.so
62+ LIB_NAME : libasyncprocess.a
5863 RESULT_NAME : result-linux-aarch64
5964 RESULT_PATH : result-linux-aarch64
6065 RESULT_PATH_SUB : result-async/static
6166 steps :
62- - uses : actions/checkout@v2
67+ - uses : actions/checkout@v4
6368 - name : Build on aarch64 (arm64)
6469 id : runcmd
65- uses : uraimo/run-on-arch-action@v1.0.5
70+ uses : uraimo/run-on-arch-action@v2
6671 with :
67- architecture : aarch64
68- distribution : ubuntu18 .04
72+ arch : aarch64
73+ distro : ubuntu22 .04
6974 run : |
7075 apt-get update
7176 apt-get -y install build-essential
@@ -75,16 +80,23 @@ jobs:
7580 uname
7681 uname -m
7782 gcc -v
78- rm static/${{ env.ARCH_NAME }}/${{ env.OS_NAME }}/${{ env.DLL_NAME }}
79- ./bootstrap
83+ # Generate build system
84+ libtoolize --copy --force --quiet
85+ aclocal
86+ autoheader
87+ automake --add-missing --copy --foreign
88+ autoconf
89+ # Configure for static build
90+ ./configure --enable-static --disable-shared LDFLAGS="-static"
91+ make
8092 - name : Copy Result
8193 if : always()
8294 run : |
8395 mkdir -p $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
84- cp static/$ARCH_NAME/$OS_NAME/$DLL_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
96+ cp .libs/$LIB_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME/
8597 - name : Upload Result
8698 if : always()
87- uses : actions/upload-artifact@v1
99+ uses : actions/upload-artifact@v4
88100 with :
89101 name : ${{ env.RESULT_NAME }}
90102 path : ${{ env.RESULT_PATH }}
@@ -95,12 +107,12 @@ jobs:
95107 env :
96108 OS_NAME : unknown
97109 ARCH_NAME : unknown
98- DLL_NAME : libasyncprocess.so
110+ LIB_NAME : libasyncprocess.a
99111 RESULT_NAME : result-osx
100112 RESULT_PATH : result-osx
101113 RESULT_PATH_SUB : result-async/static
102114 steps :
103- - uses : actions/checkout@v2
115+ - uses : actions/checkout@v4
104116 - name : Set environment variables
105117 run : |
106118 pwd
@@ -113,23 +125,45 @@ jobs:
113125 - name : Install tools
114126 run : |
115127 brew install automake
116- #brew install libtool
117- which glibtoolize
118- ln -s /usr/local/bin/glibtoolize /usr/local/bin/libtoolize
119- which libtoolize
128+ brew install libtool
120129 - name : Build
121130 run : |
122131 gcc -v
123- rm static/$ARCH_NAME/$OS_NAME/$DLL_NAME
124- ./bootstrap
132+ # Generate build system
133+ glibtoolize --copy --force --quiet
134+ aclocal
135+ autoheader
136+ automake --add-missing --copy --foreign
137+ autoconf
138+ # Configure for static build
139+ ./configure --enable-static --disable-shared
140+ make
125141 - name : Copy Result
126142 if : always()
127143 run : |
128144 mkdir -p $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
129- cp static/$ARCH_NAME/$OS_NAME/$DLL_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME
145+ cp .libs/$LIB_NAME $RESULT_PATH/$RESULT_PATH_SUB/$ARCH_NAME/$OS_NAME/
130146 - name : Upload Result
131147 if : always()
132- uses : actions/upload-artifact@v1
148+ uses : actions/upload-artifact@v4
133149 with :
134150 name : ${{ env.RESULT_NAME }}
135151 path : ${{ env.RESULT_PATH }}
152+
153+ release :
154+ runs-on : ubuntu-latest
155+ needs : [build-linux, build-linux-aarch64, build-osx]
156+ if : startsWith(github.ref, 'refs/tags/')
157+ steps :
158+ - name : Download all artifacts
159+ uses : actions/download-artifact@v4
160+ with :
161+ path : artifacts
162+
163+ - name : Create Release
164+ uses : softprops/action-gh-release@v1
165+ with :
166+ files : |
167+ artifacts/result-linux/**/*
168+ artifacts/result-linux-aarch64/**/*
169+ artifacts/result-osx/**/*
0 commit comments