7 - '.github/workflows/*'
13 - '.github/workflows/*'
21 LIBPLIST_VERSION: 2.2.0
22 OPENSSL_VERSION: 3.0.0
23 SCCACHE_VERSION: 0.2.15
27 runs-on: ubuntu-latest
37 TOOLCHAIN: ${{ matrix.triple }}-cross
38 TRIPLE: ${{ matrix.triple }}
41 - uses: actions/checkout@v1
45 - uses: actions/cache@v2
50 key: build-linux-${{ matrix.triple }}-${{ env.GITHUB_SHA }}
52 build-linux-${{ matrix.triple }}
54 - name: setup environment
56 export DOWNLOAD_PATH=${HOME}/dep_src
57 export DEP_PATH=${HOME}/build
58 mkdir -p ${DOWNLOAD_PATH} ${DEP_PATH}
59 echo "DOWNLOAD_PATH=${DOWNLOAD_PATH}" >> $GITHUB_ENV
60 echo "DEP_PATH=${DEP_PATH}" >> $GITHUB_ENV
61 echo "ARCH=$(echo ${{ matrix.triple }} | cut -d- -f 1)" >> $GITHUB_ENV
63 - name: setup toolchain
66 wget -q -nc -P ${DOWNLOAD_PATH} https://musl.cc/${TOOLCHAIN}.tgz
67 tar xf ${DOWNLOAD_PATH}/${TOOLCHAIN}.tgz -C ${HOME}
70 wget -q -nc -P ${DOWNLOAD_PATH} \
71 https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz
72 tar xf ${DOWNLOAD_PATH}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz -C ${HOME}
73 mv ${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-unknown-linux-musl/sccache ${HOME}/${TOOLCHAIN}/bin
74 chmod +x ${HOME}/${TOOLCHAIN}/bin/sccache
76 echo "${HOME}/${TOOLCHAIN}/bin" >> $GITHUB_PATH
77 echo "CC=sccache ${TRIPLE}-gcc" >> $GITHUB_ENV
78 echo "CXX=sccache ${TRIPLE}-g++" >> $GITHUB_ENV
79 echo "AR=${TRIPLE}-gcc-ar" >> $GITHUB_ENV
80 echo "NM=${TRIPLE}-gcc-nm" >> $GITHUB_ENV
81 echo "RANLIB=${TRIPLE}-gcc-ranlib" >> $GITHUB_ENV
82 echo "CFLAGS=-Os -fPIC -fno-pie -no-pie -static -flto -ffunction-sections -fdata-sections" >> $GITHUB_ENV
83 echo "LDFLAGS=-Wl,--gc-sections -Wl,-strip-all -flto" >> $GITHUB_ENV
85 - name: build libplist
87 wget -q -nc -P ${DOWNLOAD_PATH} https://github.com/libimobiledevice/libplist/releases/download/${LIBPLIST_VERSION}/libplist-${LIBPLIST_VERSION}.tar.bz2
88 tar xf ${DOWNLOAD_PATH}/libplist-${LIBPLIST_VERSION}.tar.bz2 -C ${DEP_PATH}
89 cd ${DEP_PATH}/libplist-${LIBPLIST_VERSION}
90 ./configure --host=${TRIPLE} --prefix=/usr --without-cython --enable-static --disable-shared
93 echo "CPPFLAGS=${CPPFLAGS} -I${DEP_PATH}/libplist-${LIBPLIST_VERSION}/include" >> $GITHUB_ENV
94 echo "LIBPLIST_LIB=${DEP_PATH}/libplist-${LIBPLIST_VERSION}/src/.libs/libplist-2.0.a" >> $GITHUB_ENV
98 export PLATFORM="linux-${ARCH}"
101 export PLATFORM="linux-generic32"
104 export PLATFORM="linux-x86"
107 export PLATFORM="linux64-riscv64"
111 wget -q -nc -P ${DOWNLOAD_PATH} https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
112 tar xf ${DOWNLOAD_PATH}/openssl-${OPENSSL_VERSION}.tar.gz -C ${DEP_PATH}
113 cd ${DEP_PATH}/openssl-${OPENSSL_VERSION}
114 ./config --prefix=/usr --static -static ${PLATFORM}
115 make -j$(nproc) build_generated libcrypto.a
117 echo "CPPFLAGS=${CPPFLAGS} -I${DEP_PATH}/openssl-${OPENSSL_VERSION}/include" >> $GITHUB_ENV
118 echo "LIBCRYPTO_LIB=${DEP_PATH}/openssl-${OPENSSL_VERSION}/libcrypto.a" >> $GITHUB_ENV
122 export LDID_VERSION=$(echo "$(git describe --tags --abbrev=0)")
124 VERSION="${LDID_VERSION}" \
125 LDFLAGS="-static -static-libstdc++ ${LDFLAGS}" \
126 LIBS="${LIBPLIST_LIB} ${LIBCRYPTO_LIB}"
129 - uses: actions/upload-artifact@v1
131 name: ldid_linux_${{ env.ARCH }}
134 - name: Upload Release Asset Linux
135 uses: actions/upload-release-asset@v1
136 if: ${{ github.event_name == 'release' }}
138 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140 upload_url: ${{ github.event.release.upload_url }}
142 asset_name: ldid_linux_${{ env.ARCH }}
143 asset_content_type: application/octet-stream
153 ARCH: ${{ matrix.arch }}
155 - uses: actions/checkout@v1
157 submodules: recursive
159 - uses: actions/cache@v2
162 ~/Library/Caches/Mozilla.sccache
164 key: build-macos-${{ matrix.arch }}-${ { env.GITHUB_SHA } }
166 build-macos-${{ matrix.arch }}-
168 - name: setup environment
170 export DOWNLOAD_PATH=${HOME}/dep_src
171 export DEP_PATH=${HOME}/build
172 mkdir -p ${DOWNLOAD_PATH} ${DEP_PATH}
173 echo "DOWNLOAD_PATH=${DOWNLOAD_PATH}" >> $GITHUB_ENV
174 echo "DEP_PATH=${DEP_PATH}" >> $GITHUB_ENV
176 if [ "${ARCH}" = "arm64" ]; then
177 echo "HOST_ARCH=aarch64" >> $GITHUB_ENV
179 echo "HOST_ARCH=${ARCH}" >> $GITHUB_ENV
182 - name: setup toolchain
184 brew install libtool autoconf automake
187 wget -nc -P ${DOWNLOAD_PATH} \
188 https://github.com/mozilla/sccache/releases/download/v${SCCACHE_VERSION}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin.tar.gz
189 tar xf ${DOWNLOAD_PATH}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin.tar.gz -C ${HOME}
190 chmod +x ${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin/sccache
192 echo "${HOME}/sccache-v${SCCACHE_VERSION}-x86_64-apple-darwin" >> $GITHUB_PATH
193 echo "CC=sccache clang -arch ${ARCH} -mmacosx-version-min=10.13" >> $GITHUB_ENV
194 echo "CXX=sccache clang++ -arch ${ARCH} -mmacosx-version-min=10.13" >> $GITHUB_ENV
195 echo "CFLAGS=-Os" >> $GITHUB_ENV
197 - name: build libplist
199 wget -q -nc -P ${DOWNLOAD_PATH} https://github.com/libimobiledevice/libplist/releases/download/${LIBPLIST_VERSION}/libplist-${LIBPLIST_VERSION}.tar.bz2
200 tar xf ${DOWNLOAD_PATH}/libplist-${LIBPLIST_VERSION}.tar.bz2 -C ${DEP_PATH}
201 cd ${DEP_PATH}/libplist-${LIBPLIST_VERSION}
202 ./configure --host=${HOST_ARCH}-apple-darwin --without-cython --enable-static --disable-shared
203 make -j$(sysctl -n hw.ncpu)
205 echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/libplist-${LIBPLIST_VERSION}/include" >> $GITHUB_ENV
206 echo "LIBPLIST_LIB=${DEP_PATH}/libplist-${LIBPLIST_VERSION}/src/.libs/libplist-2.0.a" >> $GITHUB_ENV
208 - name: build openssl
210 wget -q -nc -P ${DOWNLOAD_PATH} https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz
211 tar xf ${DOWNLOAD_PATH}/openssl-${OPENSSL_VERSION}.tar.gz -C ${DEP_PATH}
212 cd ${DEP_PATH}/openssl-${OPENSSL_VERSION}
213 ./config --prefix=/usr no-shared darwin64-${ARCH}
214 make -j$(sysctl -n hw.ncpu) build_generated libcrypto.a
216 echo "CFLAGS=${CFLAGS} -I${DEP_PATH}/openssl-${OPENSSL_VERSION}/include" >> $GITHUB_ENV
217 echo "LIBCRYPTO_LIB=${DEP_PATH}/openssl-${OPENSSL_VERSION}/libcrypto.a" >> $GITHUB_ENV
221 export LDID_VERSION=$(echo "$(git describe --tags --abbrev=0)")
222 make -j$(sysctl -n hw.ncpu) \
223 CFLAGS="${CFLAGS} -flto=thin" \
224 VERSION="${LDID_VERSION}" \
225 LIBS="${LIBPLIST_LIB} ${LIBCRYPTO_LIB}"
228 - uses: actions/upload-artifact@v1
230 name: ldid_macos_${{ matrix.arch }}
233 - name: Upload Release Asset Linux
234 uses: actions/upload-release-asset@v1
235 if: ${{ github.event_name == 'release' }}
237 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
239 upload_url: ${{ github.event.release.upload_url }}
241 asset_name: ldid_macos_${{ matrix.arch }}
242 asset_content_type: application/octet-stream