Skip to content

Commit 7cd0c90

Browse files
committed
忘git add了测
1 parent 057d91c commit 7cd0c90

File tree

2 files changed

+69
-2
lines changed

2 files changed

+69
-2
lines changed

.github/workflows/build-ci.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ jobs:
3737
run: |
3838
mkdir build && cd build
3939
cmake -G Ninja -DCMAKE_BUILD_TYPE=DEBUG .. && cmake --build .
40-
pwd && ls
41-
cd .. && pwd && ls
40+
4241
- uses: actions/upload-artifact@v3
4342
with:
4443
name: windows
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
on:
2+
workflow_dispatch:
3+
push:
4+
branches:
5+
- master
6+
7+
8+
jobs:
9+
check-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v2
15+
16+
- name: Check Release Commit
17+
run: |
18+
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then
19+
releaseField=$(git log -1 --pretty=format:'%B' | grep -oE 'RELEASE: [^\n]+' | cut -d' ' -f2)
20+
21+
if [[ -n "$releaseField" ]]; then
22+
echo "Release field found. Continuing with subsequent jobs."
23+
else
24+
echo "No release field found. Exiting with code 78."
25+
exit 78 # Exit code 78 skips subsequent jobs
26+
fi
27+
else
28+
echo "Not a push to master branch. Exiting with code 78."
29+
exit 78 # Exit code 78 skips subsequent jobs
30+
fi
31+
shell: bash
32+
build-linux:
33+
needs: check-release
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@master
37+
- name: build
38+
run: |
39+
mkdir build && cd build && cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build .
40+
- uses: actions/upload-artifact@v3
41+
with:
42+
name: linux
43+
path: build/json
44+
build-windows:
45+
needs: check-release
46+
runs-on: windows-latest
47+
steps:
48+
- uses: actions/checkout@master
49+
- name: set up Msys2
50+
uses: msys2/setup-msys2@v2
51+
with:
52+
msystem: ucrt64
53+
install: >-
54+
libiconv-devel
55+
cmake
56+
gcc
57+
ninja
58+
pkg-config
59+
60+
- name: build
61+
shell: msys2 {0}
62+
run: |
63+
mkdir build && cd build
64+
cmake -G Ninja -DCMAKE_BUILD_TYPE=RELEASE .. && cmake --build .
65+
- uses: actions/upload-artifact@v3
66+
with:
67+
name: windows
68+
path: build/json.exe

0 commit comments

Comments
 (0)