forked from calref/cboe
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (133 loc) · 5.57 KB
/
release.yml
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
136
on:
push:
branches:
- builds
tags:
- "v*.*.*"
pull_request:
branches:
- builds
jobs:
release:
env:
MACOSX_DEPLOYMENT_TARGET: 10.15
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
PROD_MACOS_CERTIFICATE: '${{ secrets.PROD_MACOS_CERTIFICATE }}'
PROD_MACOS_CERTIFICATE_PWD: '${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}'
PROD_MACOS_CERTIFICATE_NAME: '${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}'
PROD_MACOS_CI_KEYCHAIN_PWD: '${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}'
PROD_MACOS_NOTARIZATION_APPLE_ID: '${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}'
PROD_MACOS_NOTARIZATION_TEAM_ID: '${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}'
PROD_MACOS_NOTARIZATION_PWD: '${{ secrets.PROD_MACOS_NOTARIZATION_PWD }}'
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
DEBUG_FLAG: ${{ matrix.configuration == 'Debug' && 'true' || 'false' }}
BUILD_OS: ${{ matrix.os.name }}
strategy:
fail-fast: false
matrix:
os:
- name: macos
version: 12
scons-script: './.github/workflows/scripts/mac/scons-build.sh'
path-separator: ':'
- name: ubuntu
version: 22.04
scons-script: scons
path-separator: ':'
- name: windows
version: 2019
scons-script: './.github/workflows/scripts/win/scons-build.bat'
path-separator: ';'
boost-version:
- 1.85.0
sfml-version:
- 2.6.1
configuration:
- Release
- Debug
runs-on: '${{ matrix.os.name }}-${{ matrix.os.version }}'
steps:
- run: echo $DEBUG_FLAG
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: "core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');"
- name: checkout
uses: actions/checkout@v4
with:
submodules: true
- name: CMake zlib for linux
run: cmake -S . -B build
working-directory: deps/zlib
if: ${{ matrix.os.name == 'ubuntu' }}
- name: CMake zlib for windows
run: cmake -S . -B build -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
working-directory: deps/zlib
if: ${{ matrix.os.name == 'windows' }}
- name: Build zlib for linux
run: make && sudo make install
working-directory: deps/zlib/build
if: ${{ matrix.os.name == 'ubuntu' }}
- name: Build zlib for windows
run: './.github/workflows/scripts/win/zlib-build.bat x64'
if: ${{ matrix.os.name == 'windows' }}
- name: Cache Boost
uses: actions/cache@v4
with:
path: '${{ runner.workspace }}/boost_*.tar.gz'
key: 'boost-${{ matrix.boost-version }}'
- name: Build Boost
id: boost
uses: egor-tensin/build-boost@v1
with:
version: ${{ matrix.boost-version }}
libraries: filesystem system
platform: x64
configuration: ${{ matrix.configuration }}
static: ${{ matrix.os.name == 'windows' }}
- name: upload boost libs for inspection
uses: actions/upload-artifact@v4
with:
name: boost-artifact-${{ matrix.os.name }}-${{ matrix.configuration }}
path: ${{ steps.boost.outputs.librarydir }}
- name: Build SFML
id: sfml
uses: oprypin/install-sfml@v1
with:
sfml: ${{ matrix.sfml-version }}
config: ${{ matrix.configuration }}
- name: Windows build dependencies
run: 'vcpkg install libxml2 && pip install scons'
if: ${{ matrix.os.name == 'windows' }}
- name: Mac build dependencies
run: brew install scons
if: ${{ matrix.os.name == 'macos' }}
- name: Linux build dependencies
run: sudo apt-get update && sudo apt-get install scons libxml2-utils zenity
if: ${{ matrix.os.name == 'ubuntu' }}
- name: Install TGUI
run: 'sudo ./.github/workflows/scripts/linux/install-tgui.sh'
if: ${{ matrix.os.name == 'ubuntu' }}
- name: Build
run: '${{ matrix.os.scons-script }} INCLUDEPATH="${{ steps.boost.outputs.root }}${{ matrix.os.path-separator }}${{steps.sfml.outputs.path}}/include" LIBPATH="${{ steps.boost.outputs.librarydir }}${{ matrix.os.path-separator }}${{steps.sfml.outputs.path}}/lib${{ matrix.os.path-separator }}/usr/local/lib" FRAMEWORKPATH="${{steps.sfml.outputs.path}}/lib" test=false debug=$DEBUG_FLAG'
shell: bash
- name: Codesign and notarize
run: './.github/workflows/scripts/mac/sign-apps.sh'
if: ${{ matrix.os.name == 'macos' }}
- name: 'Tar files'
run: 'tar -cvf cboe-${{ matrix.os.name }}-${{ matrix.configuration }}.tar "Blades of Exile"'
working-directory: '${{ github.workspace }}/build'
- name: 'Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: cboe-${{ matrix.os.name }}-${{ matrix.configuration }}
path: '${{ github.workspace }}/build/cboe-${{ matrix.os.name }}-${{ matrix.configuration }}.tar'
- name: Github release
uses: softprops/action-gh-release@v2
with:
files: '${{ github.workspace }}/build/cboe-${{ matrix.os.name }}-${{ matrix.configuration }}.tar'
if: ${{ startsWith(github.ref, 'refs/tags/') }}
- name: 'Itch.io release'
run: './.github/workflows/scripts/butler_push.sh'
shell: bash
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.configuration == 'Release' }}