Skip to content

Commit 321682f

Browse files
committed
Add github workflow that provides build when release
1 parent dc189a5 commit 321682f

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: C++ Build and Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
env:
12+
TAG_NAME: ${{ github.ref_name }}
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Build (Release)
18+
run: |
19+
cmake -S ${{github.workspace}}/AimGL -B ${{github.workspace}}/build-release -DCMAKE_BUILD_TYPE=Release
20+
cmake --build ${{github.workspace}}/build-release --config Release --target AimGLApp
21+
22+
- name: Package (Release)
23+
run: |
24+
Compress-Archive -Path "${{github.workspace}}/build-release/src/*" -DestinationPath "${{github.workspace}}/build-release/src/release_windows_build_${{ env.TAG_NAME }}.zip"
25+
26+
- name: Build (Debug)
27+
run: |
28+
cmake -S ${{github.workspace}}/AimGL -B ${{github.workspace}}/build-debug -DCMAKE_BUILD_TYPE=Debug
29+
cmake --build ${{github.workspace}}/build-debug --config Debug --target AimGLApp
30+
31+
- name: Package (Debug)
32+
run: |
33+
Compress-Archive -Path "${{github.workspace}}/build-debug/src/*" -DestinationPath "${{github.workspace}}/build-debug/src/debug_windows_build_${{ env.TAG_NAME }}.zip"
34+
35+
- name: Upload Release Artifact
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: Release Windows Build
39+
path: ${{github.workspace}}/build-release/src/release_windows_build_${{ env.TAG_NAME }}.zip
40+
41+
- name: Upload Debug Artifact
42+
uses: actions/upload-artifact@v2
43+
with:
44+
name: Debug Windows Build
45+
path: ${{github.workspace}}/build-debug/src/debug_windows_build_${{ env.TAG_NAME }}.zip
46+
47+
- name: Upload Release Assets
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
files: |
51+
${{github.workspace}}\build-release\src\release_windows_build_${{ env.TAG_NAME }}.zip
52+
${{github.workspace}}\build-debug\src\debug_windows_build_${{ env.TAG_NAME }}.zip
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)