-
Notifications
You must be signed in to change notification settings - Fork 62
86 lines (72 loc) · 2.29 KB
/
build_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
name: Release
on:
release:
types:
- created
jobs:
build:
name: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- uses: actions/checkout@v1
with:
submodules: true
- name: install packages (linux)
run: |
sudo apt-get update
sudo apt-get install ninja-build libsdl2-dev
if: matrix.os == 'ubuntu-latest'
- name: install packages (macos)
run: brew install ninja SDL2
if: matrix.os == 'macos-latest'
- name: mkdir bin
run: mkdir -p bin
if: matrix.os == 'windows-latest'
- name: download sdl2 (windows)
uses: albin-johansson/download-sdl2@v1
with:
version: 2.0.14
sources_destination: .
binaries_destination: bin
if: matrix.os == 'windows-latest'
- name: mkdir out
run: mkdir -p out
- name: cmake (linux + macos)
run: cmake -S . -B out -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=out/install
if: matrix.os != 'windows-latest'
- name: cmake (windows)
run: cmake -S . -B out -DCMAKE_BUILD_TYPE=Release "-DSDL2_ROOT_DIR=SDL2-2.0.14" -DCMAKE_INSTALL_PREFIX=out/install
if: matrix.os == 'windows-latest'
- name: build
run: cmake --build out --config Release --target install
- name: strip
run: find out/install/ -type f -perm -u=x -exec strip -x {} +
if: matrix.os != 'windows-latest'
- name: archive
id: archive
run: |
OSNAME=$(echo ${{ matrix.os }} | sed 's/-latest//')
VERSION=${{ github.event.release.tag_name }}
PKGNAME="binjgb-$OSNAME"
TARBALL=$PKGNAME.tar.gz
mv out/install binjgb-$VERSION
tar -czf $TARBALL binjgb-$VERSION
echo "::set-output name=tarball::$TARBALL"
- name: upload tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.archive.outputs.tarball }}
asset_name: ${{ steps.archive.outputs.tarball }}
asset_content_type: application/gzip