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