Skip to content

Commit fefcdd0

Browse files
committed
Clean up workflows
1 parent f35a7bf commit fefcdd0

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

.github/workflows/cppcmake.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: C/C++ CI
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
68
- v*.*
79
pull_request:
@@ -11,14 +13,16 @@ on:
1113
jobs:
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:
@@ -43,7 +47,6 @@ jobs:
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

Comments
 (0)