-
Notifications
You must be signed in to change notification settings - Fork 18
112 lines (91 loc) · 3.1 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
name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: ${{ matrix.os[0] }}
strategy:
matrix:
os: [
[macos-latest, arm64],
[macos-13, x86_64],
[ubuntu-latest, x86_64]
]
steps:
- uses: actions/checkout@v4
- name: Compile native versions
run: |
make --debug
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Create tar archive (keep executable bit)
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}-${{ matrix.os[1] }}.tar.gz bin
- uses: actions/upload-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}-${{ matrix.os[1] }}
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 -f Makefile.mingw32 --trace
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Create tar archive
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest-x86_64.tar.gz bin
- uses: actions/upload-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest-x86_64
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 "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- name: Download Mac x86_64 artifact
uses: actions/download-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-macos-13-x86_64
- name: Download Mac arm64 artifact
uses: actions/download-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-macos-latest-arm64
- name: Download Ubuntu artifact
uses: actions/download-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-ubuntu-latest-x86_64
- name: Download Windows artifact
uses: actions/download-artifact@v4
with:
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest-x86_64
- 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