@@ -3,21 +3,110 @@ name: C/C++ CI
33on :
44 push :
55 branches : [ "master" ]
6+ tags : [ "v*" ]
67 pull_request :
78 branches : [ "master" ]
9+ workflow_dispatch :
10+
11+ permissions :
12+ contents : write
813
914jobs :
1015 build :
16+ name : Build ${{ matrix.platform }}
17+ runs-on : ${{ matrix.os }}
1118
12- runs-on : ubuntu-latest
19+ strategy :
20+ fail-fast : false
21+ matrix :
22+ include :
23+ - platform : linux-x86_64
24+ os : ubuntu-latest
25+ lib_src : libbeps.so
26+ lib_dst : libbeps-linux-x86_64.so
27+ exe_src : beps
28+ exe_dst : beps-linux-x86_64
29+ - platform : macos-x86_64
30+ os : macos-15-intel
31+ lib_src : libbeps.dylib
32+ lib_dst : libbeps-macos-x86_64.dylib
33+ exe_src : beps
34+ exe_dst : beps-macos-x86_64
35+ - platform : macos-arm64
36+ os : macos-15
37+ lib_src : libbeps.dylib
38+ lib_dst : libbeps-macos-arm64.dylib
39+ exe_src : beps
40+ exe_dst : beps-macos-arm64
41+ - platform : windows-x86_64
42+ os : windows-latest
43+ lib_src : libbeps.dll
44+ lib_dst : libbeps-windows-x86_64.dll
45+ exe_src : beps.exe
46+ exe_dst : beps-windows-x86_64.exe
1347
1448 steps :
15- - uses : actions/checkout@v3
16- # - name: configure
17- # run: ./configure
18- - name : make
19- run : make
49+ - uses : actions/checkout@v4
50+
51+ - name : Setup MSYS2
52+ if : runner.os == 'Windows'
53+ uses : msys2/setup-msys2@v2
54+ with :
55+ msystem : MINGW64
56+ update : true
57+ install : make mingw-w64-x86_64-gcc
58+
59+ - name : Build
60+ if : runner.os != 'Windows'
61+ shell : bash
62+ run : make clean strip
63+
64+ - name : Build
65+ if : runner.os == 'Windows'
66+ shell : msys2 {0}
67+ run : make clean strip
68+
69+ - name : Package
70+ if : runner.os != 'Windows'
71+ shell : bash
72+ run : |
73+ mkdir -p dist
74+ cp "${{ matrix.lib_src }}" "dist/${{ matrix.lib_dst }}"
75+ cp "${{ matrix.exe_src }}" "dist/${{ matrix.exe_dst }}"
76+
77+ - name : Package
78+ if : runner.os == 'Windows'
79+ shell : msys2 {0}
80+ run : |
81+ mkdir -p dist
82+ cp "${{ matrix.lib_src }}" "dist/${{ matrix.lib_dst }}"
83+ cp "${{ matrix.exe_src }}" "dist/${{ matrix.exe_dst }}"
84+
85+ - name : Upload artifact
86+ uses : actions/upload-artifact@v4
87+ with :
88+ name : beps-${{ matrix.platform }}
89+ path : dist/*
90+ if-no-files-found : error
2091 # - name: make check
2192 # run: make check
2293 # - name: make distcheck
2394 # run: make distcheck
95+
96+ release :
97+ name : Publish release assets
98+ if : startsWith(github.ref, 'refs/tags/')
99+ needs : build
100+ runs-on : ubuntu-latest
101+
102+ steps :
103+ - name : Download build artifacts
104+ uses : actions/download-artifact@v4
105+ with :
106+ path : dist
107+ merge-multiple : true
108+
109+ - name : Upload release assets
110+ uses : softprops/action-gh-release@v2
111+ with :
112+ files : dist/*
0 commit comments