Skip to content

Commit e1af223

Browse files
authored
Fixed Github action
*Now Github actions are working *Each commit will produce a pre-release with all binaries *tags will produce Release Draft which should be reviewed by human before posting
1 parent 68e555f commit e1af223

File tree

1 file changed

+79
-32
lines changed

1 file changed

+79
-32
lines changed

.github/workflows/compilation.yml

Lines changed: 79 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,101 @@ name: CI
33
on:
44
push:
55
pull_request:
6-
repository_dispatch:
7-
types: [run_build]
86

97
jobs:
108
build:
119
runs-on: ${{ matrix.os }}
1210
strategy:
1311
matrix:
1412
os: [macos-latest, ubuntu-latest]
15-
16-
steps:
13+
14+
steps:
1715
- uses: actions/checkout@v2
18-
19-
- name: Runs all the stages in the shell
16+
17+
- name: Compile native versions
2018
run: |
21-
export PS2DEV=$PWD/ps2dev
22-
export PS2SDK=$PS2DEV/ps2sdk
23-
export GSKIT=$PS2DEV/gsKit
24-
export PATH=$PATH:$PS2DEV/bin:$PS2DEV/ee/bin:$PS2DEV/iop/bin:$PS2DEV/dvp/bin:$PS2SDK/bin
25-
make clean all install
26-
19+
make --debug
20+
2721
- name: Get short SHA
2822
id: slug
2923
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
30-
31-
- name: Compress bin folder
32-
run: |
33-
tar -zcvf bin.tar.gz ps2dev/bin
34-
24+
25+
- name: Create tar archive (keep executable bit)
26+
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}.tar.gz bin
27+
3528
- uses: actions/upload-artifact@v2
3629
with:
3730
name: ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}
38-
path: ps2dev/bin/
31+
path: |
32+
*tar.gz
33+
34+
build-win:
35+
runs-on: ubuntu-latest
36+
container: dockcross/windows-static-x86:latest
3937

40-
- name: Extract tag name
41-
if: startsWith(github.ref, 'refs/tags/')
42-
id: tag
43-
uses: actions/[email protected]
38+
steps:
39+
- uses: actions/checkout@v2
40+
41+
- name: Compile windows version with cross-compilator
42+
run: |
43+
make -f Makefile.mingw32 --trace
44+
45+
- name: Get short SHA
46+
id: slug
47+
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
48+
49+
- name: Create tar archive
50+
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest.tar.gz bin
51+
52+
- uses: actions/upload-artifact@v2
4453
with:
45-
github-token: ${{ secrets.GITHUB_TOKEN }}
46-
script: |
47-
return context.payload.ref.replace(/\/refs\/tags\//, '');
54+
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest
55+
path: |
56+
*tar.gz
57+
58+
release:
59+
needs: [build, build-win]
60+
runs-on: ubuntu-latest
61+
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
62+
steps:
63+
- uses: actions/checkout@v2
4864

49-
- name: Release
50-
if: startsWith(github.ref, 'refs/tags/')
51-
uses: softprops/action-gh-release@v1
65+
- name: Get short SHA
66+
id: slug
67+
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
68+
69+
- name: Download Mac artifact
70+
uses: actions/download-artifact@v2
71+
with:
72+
name: ps2client-${{ steps.slug.outputs.sha8 }}-macos-latest
73+
74+
- name: Download Ubuntu artifact
75+
uses: actions/download-artifact@v2
76+
with:
77+
name: ps2client-${{ steps.slug.outputs.sha8 }}-ubuntu-latest
78+
79+
- name: Download Windows artifact
80+
uses: actions/download-artifact@v2
81+
with:
82+
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest
83+
84+
- name: Create pre-release
85+
if: github.ref == 'refs/heads/master'
86+
uses: marvinpinto/action-automatic-releases@latest
87+
with:
88+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
89+
prerelease: true
90+
automatic_release_tag: "latest"
91+
title: "Development build"
92+
files: |
93+
*tar.gz
94+
95+
- name: Create Tagged Release Draft
96+
if: startsWith(github.ref, 'refs/tags/v')
97+
uses: marvinpinto/action-automatic-releases@latest
5298
with:
53-
files: ps2dev.tar.gz
54-
tag_name: ${{ steps.tag.outputs.result }}
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
100+
prerelease: false
101+
draft: true
102+
files: |
103+
*tar.gz

0 commit comments

Comments
 (0)