1+ name : CI
2+
3+ on :
4+ push :
5+ pull_request :
6+ repository_dispatch :
7+ types : [run_build]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ container : ghcr.io/pspdev/pspsdk:latest
13+ steps :
14+ - uses : actions/checkout@v2
15+
16+ - name : Install dependencies
17+ run : |
18+ apk add build-base readline-dev libusb-compat-dev
19+
20+ - name : Compile project
21+ run : |
22+ make -j $(getconf _NPROCESSORS_ONLN) clean
23+ make -j $(getconf _NPROCESSORS_ONLN)
24+ make -j $(getconf _NPROCESSORS_ONLN) -C pspsh install
25+ make -j $(getconf _NPROCESSORS_ONLN) -C usbhostfs_pc
26+ make release
27+
28+ - name : Get short SHA
29+ id : slug
30+ run : echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
31+
32+ - name : Upload artifacts
33+ if : ${{ success() }}
34+ uses : actions/upload-artifact@v2
35+ with :
36+ name : psplinkusb-${{ steps.slug.outputs.sha8 }}
37+ path : release
38+
39+ - name : Extract tag name
40+ if : startsWith(github.ref, 'refs/tags/')
41+ id : tag
42+ run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
43+
44+ - name : Compress & Rename bin folder
45+ run : |
46+ tar -zcvf psplinkusb.tar.gz release/psplink
47+
48+ - name : Create pre-release
49+ if : github.ref == 'refs/heads/master'
50+ uses : softprops/action-gh-release@v1
51+ with :
52+ files : |
53+ psplinkusb.tar.gz
54+ release/psplink_manual.pdf
55+ prerelease : true
56+ name : " Development build"
57+ tag_name : " latest"
58+ env :
59+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
60+
61+ - name : Release
62+ if : startsWith(github.ref, 'refs/tags/')
63+ uses : softprops/action-gh-release@v1
64+ with :
65+ files : |
66+ psplinkusb.tar.gz
67+ release/psplink_manual.pdf
68+ tag_name : ${{ steps.tag.outputs.VERSION }}
69+ env :
70+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments