mirror of
https://github.com/palera1n/palera1n.git
synced 2026-10-21 09:47:01 +02:00
566 lines
15 KiB
YAML
566 lines
15 KiB
YAML
name: "Build palera1n"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
tags:
|
|
- v*
|
|
paths:
|
|
- src/**
|
|
- 1stparty/**
|
|
- CMakeLists.txt
|
|
- Makefile
|
|
|
|
env:
|
|
TAG: ${{ github.ref_name }}
|
|
|
|
jobs:
|
|
build-loader:
|
|
runs-on: macos-15
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: 9faf50968854aa47de65231e2985d60f6944d627
|
|
repository: palera1n/loader
|
|
|
|
- name: Install dependencies (brew)
|
|
run: |
|
|
brew install gnu-sed
|
|
|
|
- name: Select correct Xcode
|
|
uses: mobiledevops/xcode-select-version-action@7b50160de7c8bd6a8c4ee2c2e6b5ee0983886c0b
|
|
with:
|
|
xcode-select-version: 16.4
|
|
|
|
- name: Build
|
|
run: |
|
|
agvtool new-version -all $(git rev-parse HEAD)
|
|
make package PLATFORM=iphoneos PACKAGE_NAME=palera1nLoader
|
|
make package PLATFORM=appletvos PACKAGE_NAME=palera1nLoaderTV
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: loader
|
|
path: |
|
|
packages/*
|
|
|
|
build-ramdisk:
|
|
runs-on: macos-15
|
|
needs: [build-loader]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: 7e1f6e122c3a45fc45e939293c7e2eaa1889731f
|
|
repository: palera1n/jbinit
|
|
submodules: true
|
|
|
|
- name: Download loader artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: loader
|
|
|
|
- name: Select correct Xcode
|
|
uses: mobiledevops/xcode-select-version-action@7b50160de7c8bd6a8c4ee2c2e6b5ee0983886c0b
|
|
with:
|
|
xcode-select-version: 16.4
|
|
|
|
- name: Install dependencies (brew)
|
|
run: |
|
|
brew install make gnu-sed ldid-procursus fakeroot
|
|
|
|
- name: Obtain artifacts
|
|
run: |
|
|
curl -LO https://static.palera.in/binpack.tar
|
|
install -m644 binpack.tar palera1nLoader{TV,}.ipa src
|
|
|
|
- name: Build
|
|
run: |
|
|
gmake -j1 tools
|
|
gmake -j$(sysctl -n hw.ncpu)
|
|
|
|
- name: Prepare upload directory
|
|
run: |
|
|
mkdir upload
|
|
mv src/ramdisk.dmg upload/
|
|
mv src/binpack.dmg upload/
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: embedded
|
|
path: |
|
|
upload/*
|
|
|
|
build-pongo:
|
|
runs-on: macos-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: e98323f8a09abd80fc4cbcd74dee023b91a1ec22
|
|
repository: palera1n/PongoOS
|
|
|
|
- name: Install dependencies (brew)
|
|
run: |
|
|
brew install make
|
|
|
|
- name: Build
|
|
run: |
|
|
gmake -j$(sysctl -n hw.ncpu)
|
|
|
|
- name: Prepare upload directory
|
|
run: |
|
|
mkdir upload
|
|
mv build/Pongo.bin upload/
|
|
mv build/checkra1n-kpf-pongo upload/
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: pongo
|
|
path: |
|
|
upload/*
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
needs: [build-pongo, build-ramdisk]
|
|
|
|
strategy:
|
|
matrix:
|
|
triple:
|
|
- i486-linux-musl
|
|
- x86_64-linux-musl
|
|
- armel-linux-musleabi
|
|
- aarch64-linux-musl
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
|
submodules: recursive
|
|
|
|
- name: Download Pongo
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: pongo
|
|
path: embedded/
|
|
|
|
- name: Download embedded artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: embedded
|
|
path: embedded/
|
|
|
|
- name: Download musl toolchain
|
|
run: |
|
|
curl -u ${{ secrets.ACTIONS_RESOURCES_LOGIN }} -LO https://static.palera.in/action-resources/musl-cross/${{ matrix.triple }}-cross.tar.zst
|
|
tar --zstd -xf ${{ matrix.triple }}-cross.tar.zst
|
|
find ./${{ matrix.triple }}-cross -name "*.la" -type f -delete
|
|
echo "$(pwd)/${{ matrix.triple }}-cross/bin" >> $GITHUB_PATH
|
|
|
|
- name: Install Rust target
|
|
run: |
|
|
case "${{ matrix.triple }}" in
|
|
i486-linux-musl)
|
|
rustup target add i686-unknown-linux-musl
|
|
;;
|
|
x86_64-linux-musl)
|
|
rustup target add x86_64-unknown-linux-musl
|
|
;;
|
|
armel-linux-musleabi)
|
|
rustup target add arm-unknown-linux-musleabi
|
|
;;
|
|
aarch64-linux-musl)
|
|
rustup target add aarch64-unknown-linux-musl
|
|
;;
|
|
esac
|
|
|
|
- name: Install dependencies (apt)
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y build-essential cmake autoconf automake libtool pkg-config zstd jq
|
|
|
|
- name: Build
|
|
run: |
|
|
SYSROOT_PATH="$("$PWD/${{ matrix.triple }}-cross/bin/${{ matrix.triple }}-gcc" -print-sysroot)"
|
|
|
|
CC="${{ matrix.triple }}-gcc" CXX="${{ matrix.triple }}-g++" \
|
|
make palera1n \
|
|
WITH_STATIC=1 \
|
|
WITH_TUI=1 \
|
|
WITH_CIDERRAIN=1 \
|
|
BUILD_TYPE=Release \
|
|
CMAKE_SYSROOT="$SYSROOT_PATH" \
|
|
CROSS_HOST_TRIPLE="${{ matrix.triple }}" \
|
|
JOBS=$(nproc)
|
|
${{ matrix.triple }}-strip -s build/palera1n
|
|
|
|
- name: Package
|
|
run: |
|
|
cd build
|
|
case "${{ matrix.triple }}" in
|
|
i486-linux-musl)
|
|
cpack
|
|
mv palera1n.tar.gz palera1n-linux-x86.tar.gz
|
|
;;
|
|
x86_64-linux-musl)
|
|
cpack
|
|
mv palera1n.tar.gz palera1n-linux-x86_64.tar.gz
|
|
;;
|
|
armel-linux-musleabi)
|
|
cpack
|
|
mv palera1n.tar.gz palera1n-linux-armel.tar.gz
|
|
;;
|
|
aarch64-linux-musl)
|
|
cpack
|
|
mv palera1n.tar.gz palera1n-linux-arm64.tar.gz
|
|
;;
|
|
esac
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: palera1n-${{ matrix.triple }}
|
|
path: |
|
|
build/*.tar.gz
|
|
|
|
build-macos:
|
|
runs-on: ${{ matrix.os }}
|
|
needs: [build-pongo, build-ramdisk]
|
|
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: macos-latest
|
|
arch: arm64
|
|
- os: macos-15-intel
|
|
arch: x86_64
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
|
submodules: recursive
|
|
|
|
- name: Download Pongo
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: pongo
|
|
path: embedded/
|
|
|
|
- name : Download embedded artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: embedded
|
|
path: embedded/
|
|
|
|
- name: Install dependencies (brew)
|
|
run: |
|
|
brew update
|
|
brew install make cmake autoconf automake libtool pkg-config
|
|
|
|
- name: Build
|
|
run: |
|
|
gmake palera1n WITH_STATIC=1 WITH_GUI=1 WITH_TUI=1 WITH_CIDERRAIN=1 BUILD_TYPE=Release JOBS=$(sysctl -n hw.ncpu)
|
|
strip -x build/palera1n.app/Contents/MacOS/palera1n
|
|
|
|
- name: Package
|
|
run: |
|
|
cd build && zip -r palera1n-macos-${{ matrix.arch }}.zip palera1n.app
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: palera1n-macos-${{ matrix.arch }}
|
|
path: |
|
|
build/palera1n-macos-${{ matrix.arch }}.zip
|
|
|
|
build-ios:
|
|
runs-on: macos-latest
|
|
needs: [build-pongo, build-ramdisk]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.BUILD_GITHUB_TOKEN }}
|
|
submodules: recursive
|
|
|
|
- name: Setup Procursus
|
|
uses: beerpiss/[email protected]
|
|
with:
|
|
cache: true
|
|
mirror: 'https://apt.procurs.us/'
|
|
|
|
- name: Download Pongo
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: pongo
|
|
path: embedded/
|
|
|
|
- name : Download embedded artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: embedded
|
|
path: embedded/
|
|
|
|
- name: Install dependencies (brew)
|
|
run: |
|
|
brew update
|
|
brew install make cmake libtool gnu-sed
|
|
|
|
- name: Build
|
|
run: |
|
|
gmake palera1n_xcode PLATFORM=iphoneos WITH_STATIC=1 WITH_CIDERRAIN=1 BUILD_TYPE=Release JOBS=$(sysctl -n hw.ncpu)
|
|
|
|
- name: Package
|
|
run: |
|
|
cd build
|
|
cpack -DCPACK_PACKAGE_FILE_NAME="palera1n-iphoneos-arm" \
|
|
-DCPACK_PACKAGING_INSTALL_PREFIX="/usr/"
|
|
cpack -DCPACK_PACKAGE_FILE_NAME="palera1n-iphoneos-arm64" \
|
|
-DCPACK_PACKAGING_INSTALL_PREFIX="/var/jb/usr/"
|
|
|
|
mkdir -p palera1n-iphoneos-arm64/DEBIAN
|
|
mkdir -p palera1n-iphoneos-arm/DEBIAN
|
|
tar -xf palera1n-iphoneos-arm64.tar.gz -C palera1n-iphoneos-arm64
|
|
tar -xf palera1n-iphoneos-arm.tar.gz -C palera1n-iphoneos-arm
|
|
cp ../packaging/control palera1n-iphoneos-arm64/DEBIAN/control
|
|
cp ../packaging/control palera1n-iphoneos-arm/DEBIAN/control
|
|
|
|
VERSION=$(grep '^#define PALERAIN_VERSION' ../src/globals.h | cut -d'"' -f2 | tr -cd '0-9.')
|
|
|
|
gsed 's|@DEB_ARCH@|iphoneos-arm|g' -i palera1n-iphoneos-arm/DEBIAN/control
|
|
gsed 's|@DEB_ARCH@|iphoneos-arm64|g' -i palera1n-iphoneos-arm64/DEBIAN/control
|
|
gsed 's|@DEB_VERSION@|'"$VERSION"'|g' -i palera1n-iphoneos-arm/DEBIAN/control
|
|
gsed 's|@DEB_VERSION@|'"$VERSION"'|g' -i palera1n-iphoneos-arm64/DEBIAN/control
|
|
|
|
dpkg-deb --build palera1n-iphoneos-arm64
|
|
dpkg-deb --build palera1n-iphoneos-arm
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: palera1n-iphoneos-arm64
|
|
path: |
|
|
build/*.deb
|
|
|
|
build-macos-universal:
|
|
runs-on: macos-latest
|
|
needs: [build-macos]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Download arm64 artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-macos-arm64
|
|
|
|
- name: Download x86_64 artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-macos-x86_64
|
|
|
|
- name: Install dependencies (brew)
|
|
run: |
|
|
brew update
|
|
brew install create-dmg
|
|
|
|
- name: Create universal binary
|
|
run: |
|
|
mkdir -p dist build
|
|
unzip -o palera1n-macos-arm64.zip -d build/palera1n-macos-arm64
|
|
unzip -o palera1n-macos-x86_64.zip -d dist/palera1n-macos-universal
|
|
|
|
lipo -create \
|
|
build/palera1n-macos-arm64/palera1n.app/Contents/MacOS/palera1n \
|
|
dist/palera1n-macos-universal/palera1n.app/Contents/MacOS/palera1n \
|
|
-output build/palera1n-universal-bin
|
|
|
|
mv build/palera1n-universal-bin dist/palera1n-macos-universal/palera1n.app/Contents/MacOS/palera1n
|
|
|
|
- name: Package
|
|
run: |
|
|
create-dmg \
|
|
--volname "palera1n-macos-universal" \
|
|
--volicon "packaging/drive.icns" \
|
|
--background "packaging/background.png" \
|
|
--window-pos 200 120 \
|
|
--window-size 510 350 \
|
|
--icon-size 100 \
|
|
--icon palera1n.app 160 155 \
|
|
--hide-extension palera1n.app \
|
|
--app-drop-link 350 155 \
|
|
dist/palera1n-macos-universal.dmg dist/palera1n-macos-universal
|
|
|
|
- name: Upload
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: palera1n-macos-universal
|
|
path: |
|
|
dist/palera1n-macos-universal.dmg
|
|
|
|
# build-windows:
|
|
# runs-on: windows-latest
|
|
# needs: [build-pongo, build-ramdisk]
|
|
|
|
# steps:
|
|
# - uses: actions/checkout@v4
|
|
|
|
# - name: Download Pongo
|
|
# uses: actions/download-artifact@v4
|
|
# with:
|
|
# name: pongo
|
|
# path: embedded/
|
|
|
|
# - name: Download embedded artifacts
|
|
# uses: actions/download-artifact@v4
|
|
# with:
|
|
# name: embedded
|
|
# path: embedded/
|
|
|
|
# - name: Install dependencies (choco)
|
|
# run: choco install nsis.portable
|
|
|
|
# - name: Install dependencies (msys2)
|
|
# uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884
|
|
# with:
|
|
# msystem: MINGW64
|
|
# install: >
|
|
# git
|
|
# mingw-w64-x86_64-toolchain
|
|
# mingw-w64-x86_64-cmake
|
|
# mingw-w64-x86_64-libusb
|
|
# mingw-w64-x86_64-rust
|
|
# mingw-w64-x86_64-nsis
|
|
# mingw-w64-x86_64-jq
|
|
# libtool
|
|
# openssl
|
|
# openssl-devel
|
|
# python-devel
|
|
# autoconf
|
|
# automake
|
|
# zip
|
|
# vim
|
|
# make
|
|
# patch
|
|
# update: true
|
|
|
|
# - name: Build
|
|
# shell: msys2 {0}
|
|
# run: |
|
|
# make palera1n_mingw WITH_STATIC=1 WITH_GUI=1 BUILD_TYPE=Release JOBS=$(nproc)
|
|
# strip -s build/palera1n.exe
|
|
|
|
# - name: Package
|
|
# run: |
|
|
# cd build && cpack -DCPACK_PACKAGE_FILE_NAME="palera1n-windows-x86_64-setup"
|
|
|
|
# - name: Upload
|
|
# uses: actions/upload-artifact@v4
|
|
# with:
|
|
# name: palera1n-windows-x86_64
|
|
# path: |
|
|
# build/palera1n-windows-x86_64-setup.exe
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
needs: [
|
|
build-ramdisk,
|
|
build-pongo,
|
|
build-linux,
|
|
build-macos-universal,
|
|
# build-windows,
|
|
build-ios
|
|
]
|
|
|
|
steps:
|
|
- name: Download embedded artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: embedded
|
|
path: embedded/
|
|
|
|
- name: Download Pongo
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: pongo
|
|
path: embedded/
|
|
|
|
- name: Download Linux i486 Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-i486-linux-musl
|
|
path: dist/
|
|
|
|
- name: Download Linux x86_64 Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-x86_64-linux-musl
|
|
path: dist/
|
|
|
|
- name: Download Linux armel Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-armel-linux-musleabi
|
|
path: dist/
|
|
|
|
- name: Download Linux aarch64 Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-aarch64-linux-musl
|
|
path: dist/
|
|
|
|
- name: Download macOS Universal Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-macos-universal
|
|
path: dist/
|
|
|
|
# - name: Download Windows Artifact
|
|
# uses: actions/download-artifact@v4
|
|
# with:
|
|
# name: palera1n-windows-x86_64
|
|
# path: dist/
|
|
|
|
- name: Download iOS Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: palera1n-iphoneos-arm64
|
|
path: dist/
|
|
|
|
- name: Prepare artifacts
|
|
run: |
|
|
find . -maxdepth 1 -type f -print0 | tar --null -czf ../dist/resource.tar.gz --files-from=-
|
|
working-directory: embedded
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65
|
|
with:
|
|
name: ${{ env.TAG }}
|
|
tag_name: ${{ env.TAG }}
|
|
files: |
|
|
dist/*
|
|
body: |
|
|
## What's Changed
|
|
|
|
<!-- auto generated -->
|
|
|
|
## Files
|
|
|
|
- `palera1n-iphoneos-${arch}.deb`: Palera1n for iOS jailbroken environments.
|
|
- `palera1n-linux-${arch}.tar.gz`: Palera1n for Linux on CPU architecture `${arch}`.
|
|
- `palera1n-macos-universal.dmg`: Palera1n for macOS 10.11+.
|
|
- `resources.tar.gz`: Precompiled embedded artifacts used for compiling this tool.
|
|
generate_release_notes: true
|
|
fail_on_unmatched_files: true
|
|
draft: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|