-
Notifications
You must be signed in to change notification settings - Fork 5
114 lines (95 loc) · 2.96 KB
/
Copy pathrelease-suite.yml
File metadata and controls
114 lines (95 loc) · 2.96 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
name: Release
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
permissions:
contents: write
jobs:
build-release:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
name: linux-x64
artifact: eapps-linux-x64
- os: windows-latest
name: windows-x64
artifact: eapps-windows-x64
- os: macos-latest
name: macos-arm64
artifact: eapps-macos-arm64
name: Build (${{ matrix.name }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install sdl2
- name: Configure (Unix)
if: runner.os != 'Windows'
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Configure (Windows)
if: runner.os == 'Windows'
run: cmake -B build
- name: Build
run: cmake --build build --config Release --parallel
- name: Test
run: |
cmake -B build-test -DBUILD_TESTING=ON
cmake --build build-test --config Release --parallel
ctest --test-dir build-test --output-on-failure -C Release
- name: Package (Linux)
if: runner.os == 'Linux'
run: |
mkdir -p dist
cp build/apps/suite/eapps_suite dist/ 2>/dev/null || true
tar czf ${{ matrix.artifact }}.tar.gz -C dist .
- name: Package (macOS)
if: runner.os == 'macOS'
run: |
mkdir -p dist
cp build/apps/suite/eapps_suite dist/ 2>/dev/null || true
tar czf ${{ matrix.artifact }}.tar.gz -C dist .
- name: Package (Windows)
if: runner.os == 'Windows'
run: |
New-Item -ItemType Directory -Force -Path dist
Copy-Item build\Release\*.exe dist\ -ErrorAction SilentlyContinue
Copy-Item build\apps\suite\Release\*.exe dist\ -ErrorAction SilentlyContinue
Compress-Archive -Path dist\* -DestinationPath ${{ matrix.artifact }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}
path: |
*.tar.gz
*.zip
create-release:
name: Create GitHub Release
needs: build-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v8
with:
path: release-artifacts
- name: Create release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: release-artifacts/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}