summaryrefslogtreecommitdiffstats
path: root/.github/workflows/build.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build.yml')
-rw-r--r--.github/workflows/build.yml120
1 files changed, 120 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..1d567a9
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,120 @@
1name: build
2
3on: [push]
4
5jobs:
6 build-linux-ubuntu:
7 runs-on: ubuntu-latest
8 steps:
9 - name: install dependencies
10 run: |
11 sudo apt-get install libusb-1.0-0-dev
12 - name: prepare environment
13 run: |
14 echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV
15 - uses: actions/checkout@v2
16 - name: autogen
17 run: |
18 export LDFLAGS="-Wl,-rpath=/usr/local/lib"
19 ./autogen.sh
20 - name: make
21 run: make
22 - name: make install
23 run: sudo make install
24 - name: prepare artifact
25 run: |
26 mkdir -p dest
27 DESTDIR=`pwd`/dest make install
28 tar -C dest -cf libirecovery.tar lib usr
29 - name: publish artifact
30 uses: actions/upload-artifact@v2
31 with:
32 name: libirecovery-latest_${{env.target_triplet}}
33 path: libirecovery.tar
34 build-macOS:
35 runs-on: macOS-latest
36 steps:
37 - name: install dependencies
38 run: |
39 if test -x "`which port`"; then
40 sudo port install libtool autoconf automake
41 else
42 brew install libtool autoconf automake
43 fi
44 shell: bash
45 - uses: actions/checkout@v2
46 - name: autogen
47 run: |
48 SDKDIR=`xcrun --sdk macosx --show-sdk-path`
49 TESTARCHS="arm64 x86_64"
50 USEARCHS=
51 for ARCH in $TESTARCHS; do
52 if echo "int main(int argc, char **argv) { return 0; }" |clang -arch $ARCH -o /dev/null -isysroot $SDKDIR -x c - 2>/dev/null; then
53 USEARCHS="$USEARCHS -arch $ARCH"
54 fi
55 done
56 export CFLAGS="$USEARCHS -isysroot $SDKDIR"
57 echo "Using CFLAGS: $CFLAGS"
58 ./autogen.sh
59 - name: make
60 run: make
61 - name: make install
62 run: sudo make install
63 - name: prepare artifact
64 run: |
65 mkdir -p dest
66 DESTDIR=`pwd`/dest make install
67 tar -C dest -cf libirecovery.tar usr
68 - name: publish artifact
69 uses: actions/upload-artifact@v2
70 with:
71 name: libirecovery-latest_macOS
72 path: libirecovery.tar
73 build-windows:
74 runs-on: windows-latest
75 defaults:
76 run:
77 shell: msys2 {0}
78 strategy:
79 fail-fast: false
80 matrix:
81 include: [
82 { msystem: MINGW64, arch: x86_64 },
83 { msystem: MINGW32, arch: i686 }
84 ]
85 steps:
86 - uses: msys2/setup-msys2@v2
87 with:
88 msystem: ${{ matrix.msystem }}
89 release: false
90 update: false
91 install: >-
92 base-devel
93 git
94 mingw-w64-${{ matrix.arch }}-gcc
95 make
96 libtool
97 autoconf
98 automake-wrapper
99 - name: prepare environment
100 run: |
101 dest=`echo ${{ matrix.msystem }} |tr [:upper:] [:lower:]`
102 echo "dest=$dest" >> $GITHUB_ENV
103 echo "target_triplet=`gcc -dumpmachine`" >> $GITHUB_ENV
104 - uses: actions/checkout@v2
105 - name: autogen
106 run: ./autogen.sh CC=gcc CXX=g++
107 - name: make
108 run: make
109 - name: make install
110 run: make install
111 - name: prepare artifact
112 run: |
113 mkdir -p dest
114 DESTDIR=`pwd`/dest make install
115 tar -C dest -cf libirecovery.tar ${{ env.dest }}
116 - name: publish artifact
117 uses: actions/upload-artifact@v2
118 with:
119 name: libirecovery-latest_${{ matrix.arch }}-${{ env.dest }}
120 path: libirecovery.tar