1+ name : build
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ - develop
8+ tags :
9+ - v*
10+ pull_request :
11+ branches : [ master, develop ]
12+
13+ env :
14+ # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
15+ GIT_SUBMODULE_STRATEGY : recursive
16+
17+ permissions :
18+ contents : write
19+
20+ jobs :
21+
22+ # build-android:
23+ # name: "Android"
24+ # runs-on: ubuntu-latest
25+ # steps:
26+ # - uses: actions/checkout@v2
27+ # with:
28+ # submodules: true
29+ # - uses: actions/setup-java@v1
30+ # with: { java-version: '11' }
31+
32+ # - name: Install ubuntu packages
33+ # run: sudo apt-get update && sudo apt-get install build-essential cmake ninja-build
34+
35+ # - name: Gradle build
36+ # working-directory: examples/AUI.Example.Views/android
37+ # run: ./gradlew assembleDebug
38+
39+ build-desktop :
40+ name : ${{ matrix.os }} ${{ matrix.shared_or_static }} ${{ matrix.debug_or_release }}
41+ runs-on : ${{ matrix.os }}
42+ strategy :
43+ fail-fast : false
44+ matrix :
45+ os : [windows-latest, ubuntu-latest]
46+ debug_or_release : [Debug, Release]
47+ shared_or_static : [shared, static]
48+ include :
49+ - os : windows-latest
50+ generator : " Visual Studio 17 2022"
51+ additional_cmake_args : ' -A x64'
52+ - os : ubuntu-latest
53+ generator : " Unix Makefiles"
54+ additional_cmake_args : ' '
55+
56+ steps :
57+ - uses : actions/checkout@v2
58+ with :
59+ submodules : true
60+
61+ - name : Install Linux dependencies
62+ if : matrix.os == 'ubuntu-latest'
63+ run : sudo apt-get update && sudo apt-get install pkg-config libglew-dev zlib1g-dev libssl-dev libcrypt-dev libcurl4-openssl-dev libgtk-3-dev libfontconfig-dev
64+ - name : Configure CMake
65+ # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
66+ # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
67+ run : cmake -G "${{ matrix.generator }}" -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.debug_or_release}} -DBUILD_SHARED_LIBS=${{ matrix.shared_or_static == 'shared' && 'ON' || 'OFF' }} ${{matrix.additional_cmake_flags}}
68+
69+ - name : Build project
70+ # Build your program with the given configuration
71+ run : cmake --build ${{github.workspace}}/build --config ${{matrix.debug_or_release}}
72+
73+ - name : Pack
74+ working-directory : ${{github.workspace}}/build
75+ run : cpack . -C ${{ matrix.debug_or_release }}
76+
77+ - name : Upload
78+ uses : actions/upload-artifact@v3
79+ with :
80+ path : ${{github.workspace}}/build/*.tar.gz
81+ name : ${{ matrix.os }} ${{ matrix.shared_or_static }} ${{ matrix.debug_or_release }}
82+
83+ release :
84+ # if: contains(github.ref, 'tags/v')
85+ runs-on : ubuntu-latest
86+ needs : build-desktop
87+
88+ steps :
89+ - name : Extract branch name
90+ shell : bash
91+ run : echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
92+ id : extract_branch
93+ - name : Create Release
94+ id : create_release
95+ uses : ncipollo/release-action@v1.10.0
96+ with :
97+ token : ${{ secrets.GITHUB_TOKEN }}
98+ allowUpdates : true
99+ name : ${{ steps.extract_branch.outputs.branch }}
100+ tag : ${{ github.ref }}
101+ commit : ${{ steps.extract_branch.outputs.branch }}
102+
103+ publish :
104+ # if: contains(github.ref, 'tags/v')
105+ name : Publish ${{ matrix.os }} ${{ matrix.shared_or_static }} ${{ matrix.debug_or_release }}
106+ runs-on : ubuntu-latest
107+ strategy :
108+ fail-fast : false
109+ matrix :
110+ os : [windows-latest, ubuntu-latest]
111+ debug_or_release : [Debug, Release]
112+ shared_or_static : [shared, static]
113+
114+ needs : release
115+ steps :
116+ - name : Download artifact
117+ uses : actions/download-artifact@v1
118+ with :
119+ path : ./
120+ name : ${{ matrix.os }} ${{ matrix.shared_or_static }} ${{matrix.debug_or_release }}
121+
122+ - name : Extract branch name
123+ shell : bash
124+ run : echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
125+ id : extract_branch
126+ - name : Upload Release
127+ id : create_release
128+ uses : ncipollo/release-action@v1.10.0
129+ with :
130+ token : ${{ secrets.GITHUB_TOKEN }}
131+ allowUpdates : true
132+ name : ${{ steps.extract_branch.outputs.branch }}
133+ tag : ${{ github.ref }}
134+ commit : ${{ steps.extract_branch.outputs.branch }}
135+ artifacts : " *.tar.gz"
0 commit comments