@@ -2,75 +2,79 @@ name: C/C++ CI
22
33on :
44 push :
5+ branches :
6+ - main
57 tags :
6- - v*.*
8+ - v*.*
79 pull_request :
810 branches :
9- - main
11+ - main
1012
1113jobs :
1214 build :
1315 name : ${{ matrix.config.name }}
16+ permissions :
17+ contents : read
1418 runs-on : ${{ matrix.config.os }}
1519 strategy :
1620 matrix :
1721 config :
18- - {name: "ubuntu-latest", os: ubuntu-latest, cmake_extra: ""}
19- - {name: "windows-x64", os: windows-latest, cmake_extra: "-T v143"}
20- - {name: "windows-32", os: windows-latest, cmake_extra: "-T v143 -A Win32"}
21- - {name: "macOS-latest", os: macOS-latest, cmake_extra: ""}
22+ - { name: "ubuntu-latest", os: ubuntu-latest, cmake_extra: "" }
23+ - { name: "windows-x64", os: windows-latest, cmake_extra: "-T v143" }
24+ - {
25+ name : " windows-x32" ,
26+ os : windows-latest,
27+ cmake_extra : " -T v143 -A Win32" ,
28+ }
29+ - { name: "macOS-latest", os: macos-latest, cmake_extra: "" }
2230 fail-fast : false
23-
31+
2432 steps :
25- - uses : actions/checkout@v3
26-
27- - name : CMake version
28- run : cmake --version
29-
30- - name : Configure CMake
31- shell : bash
32- run : |
33- cmake -S . -B build ${{ matrix.config.cmake_extra }} -DCMAKE_INSTALL_PREFIX=${PWD}/build/install -DCPACK_PACKAGE_DIRECTORY=${PWD}/build/package -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
34-
35- - name : Make
36- run : cmake --build build --config Release -j
37-
38- - name : Install
39- run : cmake --build build --config Release -j --target install
40-
41- - name : Package
42- run : cmake --build build --config Release -j --target package
43-
44- - name : Upload Artifact
45- uses : actions/upload-artifact@v3
46- # if: "!startsWith(github.ref, 'refs/heads')"
47- with :
48- name : pkg-${{ matrix.config.name }}
49- path : |
33+ - uses : actions/checkout@v6
34+
35+ - name : CMake version
36+ run : cmake --version
37+
38+ - name : Configure CMake
39+ shell : bash
40+ run : |
41+ cmake -S . -B build ${{ matrix.config.cmake_extra }} -DCMAKE_INSTALL_PREFIX=${PWD}/build/install -DCPACK_PACKAGE_DIRECTORY=${PWD}/build/package -DCPACK_DEBIAN_PACKAGE_SHLIBDEPS=ON
42+
43+ - name : Make
44+ run : cmake --build build --config Release -j
45+
46+ - name : Install
47+ run : cmake --build build --config Release -j --target install
48+
49+ - name : Package
50+ run : cmake --build build --config Release -j --target package
51+
52+ - name : Upload Artifact
53+ uses : actions/upload-artifact@v7
54+ with :
55+ name : pkg-${{ matrix.config.name }}
56+ path : |
5057 build/package/*.deb
5158 build/package/*.tar.bz2
5259 build/package/*.zip
5360
54-
5561 release :
5662 needs : build
63+ if : startsWith(github.ref, 'refs/tags/')
5764 runs-on : ubuntu-latest
65+ permissions :
66+ contents : write
5867 steps :
59-
60- - name : Download Artifacts
61- if : startsWith(github.ref, 'refs/tags/')
62- uses : actions/download-artifact@v3
63-
64- - name : Create Release
65- if : startsWith(github.ref, 'refs/tags/')
66- id : create_release
67- uses : softprops/action-gh-release@v1
68- env :
68+ - name : Download Artifacts
69+ uses : actions/download-artifact@v8
70+
71+ - name : Create Release
72+ id : create_release
73+ uses : softprops/action-gh-release@v2
74+ env :
6975 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
70- with :
71- # tag_name: ${{ github.ref }} # ${{ github.ref }} is default
72- name : Release ${{ github.ref }}
73- draft : false
74- prerelease : false
75- # body_path: CHANGELOG.txt
76- files : ' pkg-*/*'
76+ with :
77+ name : ${{ github.ref_name }}
78+ draft : false
79+ prerelease : false
80+ files : " pkg-*/*"
0 commit comments