-
Notifications
You must be signed in to change notification settings - Fork 9
198 lines (166 loc) · 5.63 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
name: CI-compile
on:
push:
pull_request:
jobs:
build:
name: PS2Ident compilation
runs-on: ubuntu-latest
container: ps2dev/ps2dev:v1.0
# instead of "ps2dev/ps2dev:latest" you can use different tags, for example for old projects you can use "ps2dev/ps2dev:v1.0"
steps:
- name: Install dependencies
run: |
apk add build-base git zip
- uses: actions/checkout@v3
- name: Compile project
run: |
make
# commands for compiling your project
- name: Get short SHA and repository name
id: slug
run: |
echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
echo "::set-output name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")"
- name: Upload artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}
path: |
PS2Ident.elf
PS2Ident.db
README.md
changelog.txt
LICENSE_OFL.txt
*.ttf
- name: Compile PCSX2 version
continue-on-error: true
run: |
make clean
make DEBUG=1 DSNET_HOST_SUPPORT=1 DISABLE_ILINK_DUMPING=1
- name: Upload PCSX2 artifacts
if: ${{ success() }}
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PCSX2
path: |
PS2Ident.elf
PS2Ident.db
README.md
changelog.txt
LICENSE_OFL.txt
*.ttf
- name: Compile PS2TOOL version
continue-on-error: true
run: |
make clean
make DEBUG=1 DSNET_HOST_SUPPORT=1
- name: Upload PS2TOOL artifacts
if: ${{ success() }}
continue-on-error: true
uses: actions/upload-artifact@v3
with:
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL
path: |
PS2Ident_np.elf
PS2Ident.db
README.md
changelog.txt
LICENSE_OFL.txt
*.ttf
# 'path' will create artifact with all *.elf in working directory
# you can change this
build-ps2idbms:
name: PS2IDdbms compilation
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup msbuild
uses: microsoft/[email protected]
- name: Build
run: |
cd PS2IDBMS
msbuild /p:Configuration=Release
- uses: actions/upload-artifact@v3
with:
name: PS2IDBMS
path: PS2IDBMS/Release/PS2IDBMS.exe
build-romimg:
name: ROMIMG compilation
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup msbuild
uses: microsoft/[email protected]
- name: Build
run: |
cd ROMIMG
msbuild /p:PlatformToolset=v142 /p:Configuration=Release
- uses: actions/upload-artifact@v3
with:
name: ROMIMG
path: ROMIMG/Release/ROMIMG.exe
release:
needs: [build, build-ps2idbms,build-romimg]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Get short SHA and repository name
id: slug
run: |
echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
echo "::set-output name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")"
- name: Download PS2Ident artifact
uses: actions/[email protected]
with:
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}
path: PS2Ident
- name: Prepare PS2Ident archive
run: |
7z a ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}.7z PS2Ident/*
- name: Download PS2Ident for PS2TOOL artifact
uses: actions/[email protected]
with:
name: ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL
path: PS2Ident-PS2TOOL
- name: Prepare PS2Ident for PS2TOOL archive
run: |
7z a ${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL.7z PS2Ident-PS2TOOL/*
- name: Download ps2idbms artifact
uses: actions/[email protected]
with:
name: PS2IDBMS
- name: Download romimg artifact
uses: actions/[email protected]
with:
name: ROMIMG
- 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: |
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}.7z
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL.7z
PS2IDBMS.exe
ROMIMG.exe
- 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
automatic_release_tag: "stable"
draft: true
files: |
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}.7z
${{ steps.slug.outputs.REPOSITORY_NAME }}-${{ steps.slug.outputs.sha8 }}-PS2TOOL.7z
PS2IDBMS.exe