14 LIBPLIST_VERSION: 2.2.0
15 OPENSSL_VERSION: 3.0.0
16 SCCACHE_VERSION: 0.2.15
20 runs-on: ubuntu-latest
30 TOOLCHAIN: ${{ matrix.triple }}-cross
31 TRIPLE: ${{ matrix.triple }}
34 - uses: actions/checkout@v1
38 - uses: actions/cache@v2
43 key: build-linux-${{ matrix.triple }}-${{ env.GITHUB_SHA }}
45 build-linux-${{ matrix.triple }}
47 - name: setup environment
49 export DOWNLOAD_PATH=${HOME}/dep_src
50 export DEP_PATH=${HOME}/build
51 mkdir -p ${DOWNLOAD_PATH} ${DEP_PATH}
52 echo "DOWNLOAD_PATH=${DOWNLOAD_PATH}" >> $GITHUB_ENV
53 echo "DEP_PATH=${DEP_PATH}" >> $GITHUB_ENV
54 echo "ARCH=$(echo ${{ matrix.triple }} | cut -d- -f 1)" >> $GITHUB_ENV
56 - name: setup toolchain
59 wget -q -nc -P ${DOWNLOAD_PATH} https://musl.cc/${TOOLCHAIN}.tgz
60 tar xf ${DOWNLOAD_PATH}/${TOOLCHAIN}.tgz -C ${HOME}
63 wget -q -nc -P ${DOWNLOAD_PATH} \
64 https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz
65 tar xf ${DOWNLOAD_PATH}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz -C ${HOME}
66 mv ${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache ${HOME}/${TOOLCHAIN}/bin
67 chmod +x ${HOME}/${TOOLCHAIN}/bin/sccache
69 echo "${HOME}/${TOOLCHAIN}/bin" >> $GITHUB_PATH
70 echo "CC=sccache ${TRIPLE}-gcc" >> $GITHUB_ENV
71 echo "CXX=sccache ${TRIPLE}-g++" >> $GITHUB_ENV
72 echo "CFLAGS=-Os -static" >> $GITHUB_ENV
74 - name: build libplist
76 wget -q -nc -P ${DOWNLOAD_PATH} https://github.com/libimobiledevice/libplist/releases/download/${LIBPLIST_VERSION}/libplist-${LIBPLIST_VERSION}.tar.bz2
77 tar xf ${DOWNLOAD_PATH}/libplist-${LIBPLIST_VERSION}.tar.bz2 -C ${DEP_PATH}
78 cd ${DEP_PATH}/libplist-${LIBPLIST_VERSION}
79 ./configure --host=${TRIPLE} --prefix=/usr --without-cython --enable-static --disable-shared
82 echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/libplist-${LIBPLIST_VERSION}/include" >> $GITHUB_ENV
83 echo "LIBPLIST_LIB=${DEP_PATH}/libplist-${LIBPLIST_VERSION}/src/.libs/libplist-2.0.a" >> $GITHUB_ENV
87 export PLATFORM="linux-${ARCH}"
90 export PLATFORM="linux-generic32"
93 export PLATFORM="linux-x86"
96 export PLATFORM="linux64-riscv64"
100 wget -q -nc -P ${DOWNLOAD_PATH} https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
101 tar xf ${DOWNLOAD_PATH}/openssl-${OPENSSL_VERSION}.tar.gz -C ${DEP_PATH}
102 cd ${DEP_PATH}/openssl-${OPENSSL_VERSION}
103 ./config --prefix=/usr --static -static ${PLATFORM}
104 make -j$(nproc) build_generated libcrypto.a
106 echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/openssl-${OPENSSL_VERSION}/include" >> $GITHUB_ENV
107 echo "LIBCRYPTO_LIB=${DEP_PATH}/openssl-${OPENSSL_VERSION}/libcrypto.a" >> $GITHUB_ENV
111 export LDID_VERSION=$(echo "$(git describe --tags --abbrev=0)")
113 VERSION="${LDID_VERSION}" \
114 LIBS="${LIBPLIST_LIB} ${LIBCRYPTO_LIB}"
117 - uses: actions/upload-artifact@v1
119 name: ldid_linux_${{ env.ARCH }}
122 - name: Upload Release Asset Linux
123 uses: actions/upload-release-asset@v1
124 if: ${{ github.event_name == 'release' }}
126 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128 upload_url: ${{ github.event.release.upload_url }}
130 asset_name: ldid_linux_${{ env.ARCH }}
131 asset_content_type: application/octet-stream
141 ARCH: ${{ matrix.arch }}
143 - uses: actions/checkout@v1
145 submodules: recursive
147 - uses: actions/cache@v2
150 ~/Library/Caches/Mozilla.sccache
152 key: build-macos-${{ matrix.arch }}-${ { env.GITHUB_SHA } }
154 build-macos-${{ matrix.arch }}-
156 - name: setup environment
158 export DOWNLOAD_PATH=${HOME}/dep_src
159 export DEP_PATH=${HOME}/build
160 mkdir -p ${DOWNLOAD_PATH} ${DEP_PATH}
161 echo "DOWNLOAD_PATH=${DOWNLOAD_PATH}" >> $GITHUB_ENV
162 echo "DEP_PATH=${DEP_PATH}" >> $GITHUB_ENV
164 if [ "${ARCH}" = "arm64" ]; then
165 echo "HOST_ARCH=aarch64" >> $GITHUB_ENV
167 echo "HOST_ARCH=${ARCH}" >> $GITHUB_ENV
170 - name: setup toolchain
172 brew install libtool autoconf automake
175 wget -nc -P ${DOWNLOAD_PATH} \
176 https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin.tar.gz
177 tar xf ${DOWNLOAD_PATH}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin.tar.gz -C ${HOME}
178 chmod +x ${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin/sccache
180 echo "${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin" >> $GITHUB_PATH
181 echo "CC=sccache clang -arch ${ARCH} -mmacosx-version-min=10.13" >> $GITHUB_ENV
182 echo "CXX=sccache clang++ -arch ${ARCH} -mmacosx-version-min=10.13" >> $GITHUB_ENV
183 echo "CFLAGS=-Os" >> $GITHUB_ENV
185 - name: build libplist
187 wget -q -nc -P ${DOWNLOAD_PATH} https://github.com/libimobiledevice/libplist/releases/download/${LIBPLIST_VERSION}/libplist-${LIBPLIST_VERSION}.tar.bz2
188 tar xf ${DOWNLOAD_PATH}/libplist-${LIBPLIST_VERSION}.tar.bz2 -C ${DEP_PATH}
189 cd ${DEP_PATH}/libplist-${LIBPLIST_VERSION}
190 ./configure --host=${HOST_ARCH}-apple-darwin --without-cython --enable-static --disable-shared
191 make -j$(sysctl -n hw.ncpu)
193 echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/libplist-${LIBPLIST_VERSION}/include" >> $GITHUB_ENV
194 echo "LIBPLIST_LIB=${DEP_PATH}/libplist-${LIBPLIST_VERSION}/src/.libs/libplist-2.0.a" >> $GITHUB_ENV
196 - name: build openssl
198 wget -q -nc -P ${DOWNLOAD_PATH} https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
199 tar xf ${DOWNLOAD_PATH}/openssl-${OPENSSL_VERSION}.tar.gz -C ${DEP_PATH}
200 cd ${DEP_PATH}/openssl-${OPENSSL_VERSION}
201 ./config --prefix=/usr no-shared darwin64-${ARCH}
202 make -j$(sysctl -n hw.ncpu) build_generated libcrypto.a
204 echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/openssl-${OPENSSL_VERSION}/include" >> $GITHUB_ENV
205 echo "LIBCRYPTO_LIB=${DEP_PATH}/openssl-${OPENSSL_VERSION}/libcrypto.a" >> $GITHUB_ENV
209 export LDID_VERSION=$(echo "$(git describe --tags --abbrev=0)")
210 make -j$(sysctl -n hw.ncpu) \
211 CFLAGS="${CFLAGS} -flto=thin" \
212 VERSION="${LDID_VERSION}" \
213 LIBS="${LIBPLIST_LIB} ${LIBCRYPTO_LIB}"
216 - uses: actions/upload-artifact@v1
218 name: ldid_macos_${{ matrix.arch }}
221 - name: Upload Release Asset Linux
222 uses: actions/upload-release-asset@v1
223 if: ${{ github.event_name == 'release' }}
225 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
227 upload_url: ${{ github.event.release.upload_url }}
229 asset_name: ldid_macos_${{ matrix.arch }}
230 asset_content_type: application/octet-stream