-
Notifications
You must be signed in to change notification settings - Fork 18
124 lines (103 loc) · 3.39 KB
/
compilation.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
name: CI
on:
push:
pull_request:
workflow_dispatch: {}
jobs:
build:
runs-on: ${{ matrix.os[0] }}
strategy:
matrix:
os: [[macos-latest, bash], [ubuntu-latest, bash], [windows-latest, msys2]]
fail-fast: false
defaults:
run:
shell: ${{ matrix.os[1] }} {0}
steps:
- uses: actions/checkout@v4
- name: Install MSYS2 packages
if: matrix.os[0] == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
install: |
base-devel mingw-w64-i686-gcc
update: true
- name: Compile native versions
run: |
make -j $(getconf _NPROCESSORS_ONLN) clean
make -j $(getconf _NPROCESSORS_ONLN) all
- name: Get short SHA
id: slug
run: |
echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- name: Create tar archive (keep executable bit)
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os[0]}}.tar.gz bin
- name: Upload artefacts
if: matrix.os[0] != 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os[0]}}
path: |
*tar.gz
build-win:
runs-on: ubuntu-latest
container: dockcross/windows-static-x86:latest
steps:
- uses: actions/checkout@v4
- name: Compile windows version with cross-compilator
run: |
make -j $(getconf _NPROCESSORS_ONLN) --trace clean
make -j $(getconf _NPROCESSORS_ONLN) --trace all
- name: Get short SHA
id: slug
run: |
echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- name: Create tar archive
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest.tar.gz bin
- uses: actions/upload-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest
path: |
*tar.gz
release:
needs: [build, build-win]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Get short SHA
id: slug
run: |
echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
- name: Download Mac artifact
uses: actions/download-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-macos-latest
- name: Download Ubuntu artifact
uses: actions/download-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-ubuntu-latest
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest
- name: Create pre-release
if: github.ref == 'refs/heads/master'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "latest"
title: "Development build"
files: |
*tar.gz
- name: Create Tagged Release Draft
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: true
files: |
*tar.gz