diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 186 |
1 files changed, 186 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9d36f2a --- /dev/null +++ b/.github/workflows/build.yml | |||
@@ -0,0 +1,186 @@ | |||
1 | name: build | ||
2 | |||
3 | on: | ||
4 | push: | ||
5 | schedule: | ||
6 | - cron: '0 0 1 * *' | ||
7 | |||
8 | jobs: | ||
9 | build-linux-ubuntu: | ||
10 | runs-on: ubuntu-latest | ||
11 | steps: | ||
12 | - name: install dependencies | ||
13 | run: | | ||
14 | sudo apt-get update | ||
15 | sudo apt-get install libusb-1.0-0-dev | ||
16 | - name: prepare environment | ||
17 | run: | | ||
18 | echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV | ||
19 | - name: fetch libplist | ||
20 | uses: dawidd6/action-download-artifact@v3 | ||
21 | with: | ||
22 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
23 | workflow: build.yml | ||
24 | name: libplist-latest_${{env.target_triplet}} | ||
25 | repo: libimobiledevice/libplist | ||
26 | - name: fetch libimobiledevice-glue | ||
27 | uses: dawidd6/action-download-artifact@v3 | ||
28 | with: | ||
29 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
30 | workflow: build.yml | ||
31 | name: libimobiledevice-glue-latest_${{env.target_triplet}} | ||
32 | repo: libimobiledevice/libimobiledevice-glue | ||
33 | - name: install external dependencies | ||
34 | run: | | ||
35 | mkdir extract | ||
36 | for I in *.tar; do | ||
37 | tar -C extract -xvf $I | ||
38 | done | ||
39 | sudo cp -r extract/* / | ||
40 | sudo ldconfig | ||
41 | - uses: actions/checkout@v4 | ||
42 | - name: autogen | ||
43 | run: ./autogen.sh PKG_CONFIG_PATH=/usr/local/lib/pkgconfig LDFLAGS="-Wl,-rpath=/usr/local/lib" | ||
44 | - name: make | ||
45 | run: make | ||
46 | - name: make install | ||
47 | run: sudo make install | ||
48 | - name: prepare artifact | ||
49 | run: | | ||
50 | mkdir -p dest | ||
51 | DESTDIR=`pwd`/dest make install | ||
52 | tar -C dest -cf libirecovery.tar lib usr | ||
53 | - name: publish artifact | ||
54 | uses: actions/upload-artifact@v4 | ||
55 | with: | ||
56 | name: libirecovery-latest_${{env.target_triplet}} | ||
57 | path: libirecovery.tar | ||
58 | build-macOS: | ||
59 | runs-on: macOS-latest | ||
60 | steps: | ||
61 | - name: install dependencies | ||
62 | run: | | ||
63 | if test -x "`which port`"; then | ||
64 | sudo port install libtool autoconf automake pkgconfig | ||
65 | else | ||
66 | brew install libtool autoconf automake pkgconfig | ||
67 | fi | ||
68 | shell: bash | ||
69 | - name: fetch libplist | ||
70 | uses: dawidd6/action-download-artifact@v3 | ||
71 | with: | ||
72 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
73 | workflow: build.yml | ||
74 | name: libplist-latest_macOS | ||
75 | repo: libimobiledevice/libplist | ||
76 | - name: fetch libimobiledevice-glue | ||
77 | uses: dawidd6/action-download-artifact@v3 | ||
78 | with: | ||
79 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
80 | workflow: build.yml | ||
81 | name: libimobiledevice-glue-latest_macOS | ||
82 | repo: libimobiledevice/libimobiledevice-glue | ||
83 | - name: install external dependencies | ||
84 | run: | | ||
85 | mkdir extract | ||
86 | for I in *.tar; do | ||
87 | tar -C extract -xvf $I | ||
88 | done | ||
89 | sudo cp -r extract/* / | ||
90 | - uses: actions/checkout@v4 | ||
91 | - name: autogen | ||
92 | run: | | ||
93 | SDKDIR=`xcrun --sdk macosx --show-sdk-path` | ||
94 | TESTARCHS="arm64 x86_64" | ||
95 | USEARCHS= | ||
96 | for ARCH in $TESTARCHS; do | ||
97 | if echo "int main(int argc, char **argv) { return 0; }" |clang -arch $ARCH -o /dev/null -isysroot $SDKDIR -x c - 2>/dev/null; then | ||
98 | USEARCHS="$USEARCHS -arch $ARCH" | ||
99 | fi | ||
100 | done | ||
101 | export CFLAGS="$USEARCHS -isysroot $SDKDIR" | ||
102 | echo "Using CFLAGS: $CFLAGS" | ||
103 | ./autogen.sh PKG_CONFIG_PATH=/usr/local/lib/pkgconfig | ||
104 | - name: make | ||
105 | run: make | ||
106 | - name: make install | ||
107 | run: sudo make install | ||
108 | - name: prepare artifact | ||
109 | run: | | ||
110 | mkdir -p dest | ||
111 | DESTDIR=`pwd`/dest make install | ||
112 | tar -C dest -cf libirecovery.tar usr | ||
113 | - name: publish artifact | ||
114 | uses: actions/upload-artifact@v4 | ||
115 | with: | ||
116 | name: libirecovery-latest_macOS | ||
117 | path: libirecovery.tar | ||
118 | build-windows: | ||
119 | runs-on: windows-2019 | ||
120 | defaults: | ||
121 | run: | ||
122 | shell: msys2 {0} | ||
123 | strategy: | ||
124 | fail-fast: false | ||
125 | matrix: | ||
126 | include: [ | ||
127 | { msystem: MINGW64, arch: x86_64 }, | ||
128 | { msystem: MINGW32, arch: i686 } | ||
129 | ] | ||
130 | steps: | ||
131 | - uses: msys2/setup-msys2@v2 | ||
132 | with: | ||
133 | msystem: ${{ matrix.msystem }} | ||
134 | release: false | ||
135 | update: false | ||
136 | install: >- | ||
137 | base-devel | ||
138 | git | ||
139 | mingw-w64-${{ matrix.arch }}-gcc | ||
140 | make | ||
141 | libtool | ||
142 | autoconf | ||
143 | automake-wrapper | ||
144 | - name: prepare environment | ||
145 | run: | | ||
146 | dest=`echo ${{ matrix.msystem }} |tr [:upper:] [:lower:]` | ||
147 | echo "dest=$dest" >> $GITHUB_ENV | ||
148 | echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV | ||
149 | - name: fetch libplist | ||
150 | uses: dawidd6/action-download-artifact@v3 | ||
151 | with: | ||
152 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
153 | workflow: build.yml | ||
154 | name: libplist-latest_${{ matrix.arch }}-${{ env.dest }} | ||
155 | repo: libimobiledevice/libplist | ||
156 | - name: fetch libimobiledevice-glue | ||
157 | uses: dawidd6/action-download-artifact@v3 | ||
158 | with: | ||
159 | github_token: ${{secrets.GITHUB_TOKEN}} | ||
160 | workflow: build.yml | ||
161 | name: libimobiledevice-glue-latest_${{ matrix.arch }}-${{ env.dest }} | ||
162 | repo: libimobiledevice/libimobiledevice-glue | ||
163 | - name: install external dependencies | ||
164 | run: | | ||
165 | mkdir extract | ||
166 | for I in *.tar; do | ||
167 | tar -C extract -xvf $I | ||
168 | done | ||
169 | cp -r extract/* / | ||
170 | - uses: actions/checkout@v4 | ||
171 | - name: autogen | ||
172 | run: ./autogen.sh CC=gcc CXX=g++ | ||
173 | - name: make | ||
174 | run: make | ||
175 | - name: make install | ||
176 | run: make install | ||
177 | - name: prepare artifact | ||
178 | run: | | ||
179 | mkdir -p dest | ||
180 | DESTDIR=`pwd`/dest make install | ||
181 | tar -C dest -cf libirecovery.tar ${{ env.dest }} | ||
182 | - name: publish artifact | ||
183 | uses: actions/upload-artifact@v4 | ||
184 | with: | ||
185 | name: libirecovery-latest_${{ matrix.arch }}-${{ env.dest }} | ||
186 | path: libirecovery.tar | ||