forked from daid/EmptyEpsilon
-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (143 loc) · 4.86 KB
/
Copy pathprerelease.yml
File metadata and controls
143 lines (143 loc) · 4.86 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
136
137
138
139
140
141
142
143
---
name: Pre-release
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
branch:
# Friendly description to be shown in the UI instead of 'name'
description: 'Branch to release'
# Default value if no value is explicitly provided
default: 'graphics-improvements'
# Input has to be provided for the workflow to run
required: true
jobs:
make_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: steps.create_release.outputs.upload_url
steps:
- name: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.event.inputs.branch }}-release
release_name: Release ${{ github.event.inputs.branch }}
draft: false
prerelease: true
linux:
name: Linux
runs-on: ubuntu-latest
needs: make_release
steps:
- name: Update apt index
run: sudo apt-get update -qq
- name: Install SFML
run: sudo apt-get install libsfml-dev
- name: Checkout EmptyEpsilon
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
- name: Build and test
run: docker/build.sh
windows-cross:
name: Windows (Cross-Compile)
runs-on: ubuntu-latest
needs: make_release
steps:
- name: Dependencies
run: |
sudo apt update -qq
sudo apt install build-essential cmake python3-minimal mingw-w64 ninja-build p7zip-full
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: gcask/SeriousProton
path: SeriousProton
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
ref: ${{ github.event.inputs.branch }}
- name: Build
run: |
mkdir -p _build_win32
cd _build_win32
cmake ../EmptyEpsilon -G Ninja -DCPACK_GENERATOR=zip -DCMAKE_MAKE_PROGRAM=ninja -DCMAKE_TOOLCHAIN_FILE=../EmptyEpsilon/cmake/mingw.toolchain -DSERIOUS_PROTON_DIR=../SeriousProton
ninja package
macos:
# https://github.com/actions/virtual-environments/issues/841
# Mac builds are flaky, disable for now.
if: ${{ false }}
name: MacOS
runs-on: macos-11.0
steps:
- name: Dependencies
run: brew install cmake sfml ninja
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: gcask/SeriousProton
path: SeriousProton
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
ref: ${{ github.event.inputs.branch }}
- name: Build
run: |
mkdir -p _build_macos
cd _build_macos
cmake ../EmptyEpsilon -G Ninja -DSERIOUS_PROTON_DIR=../SeriousProton
ninja
ninja install
windows:
name: Windows
runs-on: windows-latest
needs: make_release
strategy:
matrix:
build_type: [Debug, RelWithDebInfo, Release]
steps:
- name: Dependencies
run: |
$sfml_link = “https://www.sfml-dev.org/files/SFML-2.5.1-windows-vc15-32-bit.zip”
$sfml_zip = "${{github.workspace}}/sfml-dev.zip"
(new-object System.Net.WebClient).DownloadFile($sfml_link, $sfml_zip)
Expand-Archive -LiteralPath $sfml_zip -DestinationPath "${{github.workspace}}/externals"
- name: EmptyEpsilon Checkout
uses: actions/checkout@v2
with:
path: EmptyEpsilon
ref: ${{ github.event.inputs.branch }}
- name: SeriousProton Checkout
uses: actions/checkout@v2
with:
repository: gcask/SeriousProton
path: SeriousProton
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
working-directory: ${{github.workspace}}/build
run: >
cmake
-G "Visual Studio 16 2019" -A Win32
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DSFML_ROOT="${{github.workspace}}/externals/SFML-2.5.1"
-DSERIOUS_PROTON_DIR="../SeriousProton"
../EmptyEpsilon
- name: Build
working-directory: ${{github.workspace}}/build
run: cmake --build . --config ${{ matrix.build_type }} --target package
- name: Upload Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.make_release.outputs.upload_url }}
asset_path: ${{github.workspace}}/build/EmptyEpsilon.zip
asset_name: EmptyEpsilon-win32-${{ matrix.build_type }}.zip
asset_content_type: application/zip