@@ -2,6 +2,8 @@ name: C/C++ CI
22
33on :
44 push :
5+ branches :
6+ - main
57 tags :
68 - v*.*
79 pull_request :
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 :
1822 - {name: "ubuntu-latest", os: ubuntu-latest, cmake_extra: ""}
1923 - {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: ""}
24+ - {name: "windows-x32 ", os: windows-latest, cmake_extra: "-T v143 -A Win32"}
25+ - {name: "macOS-latest", os: macos -latest, cmake_extra: ""}
2226 fail-fast : false
2327
2428 steps :
4347
4448 - name : Upload Artifact
4549 uses : actions/upload-artifact@v7
46- # if: "!startsWith(github.ref, 'refs/heads')"
4750 with :
4851 name : pkg-${{ matrix.config.name }}
4952 path : |
@@ -54,23 +57,22 @@ jobs:
5457
5558 release :
5659 needs : build
60+ if : startsWith(github.ref, 'refs/tags/')
5761 runs-on : ubuntu-latest
62+ permissions :
63+ contents : write
5864 steps :
5965
6066 - name : Download Artifacts
61- if : startsWith(github.ref, 'refs/tags/')
6267 uses : actions/download-artifact@v8
63-
68+
6469 - name : Create Release
65- if : startsWith(github.ref, 'refs/tags/')
6670 id : create_release
6771 uses : softprops/action-gh-release@v2
6872 env :
6973 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
7074 with :
71- # tag_name: ${{ github.ref }} # ${{ github.ref }} is default
72- name : Release ${{ github.ref }}
75+ name : Release ${{ github.ref_name }}
7376 draft : false
7477 prerelease : false
75- # body_path: CHANGELOG.txt
7678 files : ' pkg-*/*'
0 commit comments