-
Notifications
You must be signed in to change notification settings - Fork 52
120 lines (116 loc) · 3.96 KB
/
build.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
name: Packages
on:
workflow_dispatch:
pull_request:
schedule:
- cron: "0 */6 * * *"
repository_dispatch:
types: [run_build]
jobs:
prepare_jobs:
runs-on: ubuntu-20.04
container: node:lts
steps:
- uses: actions/checkout@v4
- name: Install dependencies
id: set-matrix
run: |
echo "dependant=$(node create-matrix.js dependant)" >> $GITHUB_OUTPUT
echo "non_dependant=$(node create-matrix.js non_dependant)" >> $GITHUB_OUTPUT
outputs:
dependant: ${{ steps.set-matrix.outputs.dependant }}
non_dependant: ${{ steps.set-matrix.outputs.non_dependant }}
build:
needs: [prepare_jobs]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.prepare_jobs.outputs.non_dependant) }}
env:
SSHPASS: ${{ secrets.SSHPASS }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get update
sudo apt-get install fakeroot cmake cmake-data texinfo libtool-bin libarchive-tools xutils-dev python3.11
- name: Prepare Build
run: |
bash ./prepare.sh
- name: Build package
run: |
export VITASDK=/usr/local/vitasdk
export PATH=$(pwd)/../vita-makepkg:$VITASDK/bin:$PATH
bash ./build.sh ${{ matrix.package }}
- name: Rename package
run: |
export FILE=`echo ${{ matrix.package }}/*-arm.tar.xz`
mv $FILE ${{ matrix.package }}/${{ matrix.package }}.tar.xz
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package }}
path: ${{ matrix.package }}/${{ matrix.package }}.tar.xz
build_depends:
needs: [prepare_jobs, build]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.prepare_jobs.outputs.dependant) }}
env:
SSHPASS: ${{ secrets.SSHPASS }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Generate actions/download-artifact pattern
id: generate-download-artifact-pattern
run: |
PATTERN=`echo ${{ matrix.package }} | awk 'NF{NF-=1};1' | tr ' ' '|' | awk '{ print "@(" $0 ")" }'`
echo "PATTERN=$PATTERN" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
path: package
pattern: ${{ steps.generate-download-artifact-pattern.outputs.PATTERN }}
merge-multiple: true
- name: Install dependencies
run: |
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get update
sudo apt-get install fakeroot cmake cmake-data texinfo libtool-bin libarchive-tools pkg-config libc6-dev-i386 python3.11
- name: Prepare Build
run: |
bash ./prepare.sh
- name: Install and Build packages
run: |
export VITASDK=/usr/local/vitasdk
export PATH=$(pwd)/../vita-makepkg:$VITASDK/bin:$PATH
for f in ${{ matrix.package }}; do bash ./install_or_build.sh $f; done
- name: Export package
run: |
export PACKAGE=`echo ${{ matrix.package }} | awk '{print $NF}'`
echo "PACKAGE=$PACKAGE" >> $GITHUB_ENV
- name: Rename package
run: |
export FILE=`echo ${{ env.PACKAGE }}/*-arm.tar.xz`
mv $FILE ${{ env.PACKAGE }}/${{ env.PACKAGE }}.tar.xz
- uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE }}
path: ${{ env.PACKAGE }}/${{ env.PACKAGE }}.tar.xz
upload-releases:
needs: [prepare_jobs, build, build_depends]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: package
merge-multiple: true
- name: Upload release assets
if: contains(github.ref,'refs/heads/master')
run: gh release upload master package/*.tar.xz --clobber
env:
GITHUB_TOKEN: ${{ github.token }}