Skip to content

Commit 48c3624

Browse files
committed
Add github workflow that provides build when release
1 parent dc189a5 commit 48c3624

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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: cmake -S ${{github.workspace}}/AimGL -B ${{github.workspace}}/build-release -DCMAKE_BUILD_TYPE=Release
19+
20+
- name: Package (Release)
21+
run: |
22+
cd ${{github.workspace}}/build-release/src/
23+
zip -r release_windows_build_${{ env.TAG_NAME }}.zip ./resources/* *.dll *.exe *.lib
24+
cd ${{github.workspace}}
25+
26+
- name: Build (Debug)
27+
run: cmake -S ${{github.workspace}}/AimGL -B ${{github.workspace}}/build-debug -DCMAKE_BUILD_TYPE=Debug
28+
29+
- name: Package (Debug)
30+
run: |
31+
cd ${{github.workspace}}/build-debug/src/
32+
zip -r debug_windows_build_${{ env.TAG_NAME }}.zip ./resources/* *.dll *.exe *.lib
33+
cd ${{github.workspace}}
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

0 commit comments

Comments
 (0)