ποΈ Build βοΈ Weekly (toolpack_aarch64_arm64) Binaries π¦ποΈ #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ποΈ Build βοΈ Weekly (toolpack_aarch64_arm64) Binaries π¦ποΈ | |
#MAX_RUNTIME: | |
on: | |
workflow_dispatch: | |
schedule: | |
#- cron: "0 1 * * *" # 06:45 AM NPT Mrng Every Day | |
- cron: "0 0 */2 * *" #Every 2 days (48 Hr) | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOOLPACKS }} | |
jobs: | |
#------------------------------------------------------------------------------------# | |
#------------------------------------------------------------------------------------# | |
build-fetch-binaries: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
path: main | |
filter: "blob:none" #https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ | |
- name: Debloat Runner | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
#12.0 GB | |
sudo rm /usr/local/lib/android -rf 2>/dev/null | |
#8.2 GB | |
sudo rm /opt/hostedtoolcache/CodeQL -rf 2>/dev/null | |
#5.0 GB | |
sudo rm /usr/local/.ghcup -rf 2>/dev/null | |
#2.0 GB | |
sudo rm /usr/share/dotnet -rf 2>/dev/null | |
#1.7 GB | |
sudo rm /usr/share/swift -rf 2>/dev/null | |
#1.1 GB | |
#sudo rm /usr/local/lib/node_modules -rf 2>/dev/null | |
#1.0 GB | |
sudo rm /usr/local/share/powershell -rf 2>/dev/null | |
#500 MB | |
sudo rm /usr/local/lib/heroku -rf 2>/dev/null | |
continue-on-error: true | |
- name: Install CoreUtils & Deps | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
sudo apt-get update -y | |
sudo apt-get install automake b3sum build-essential ca-certificates ccache lzip jq make musl musl-dev musl-tools p7zip-full wget -y | |
sudo apt-get install -y --no-install-recommends autoconf automake autopoint binutils bison build-essential ca-certificates flex file jq patch patchelf pkg-config python3-pip qemu-user-static wget | |
#Bin Utils | |
sudo apt install binutils-aarch64-linux-gnu -y | |
#libpcap | |
sudo apt install 'libpcap*' -y | |
sudo apt install 'nmap' -y | |
continue-on-error: true | |
- name: Install Build Dependencies (arm64) | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
sudo apt-get install -y "g++-arm-linux-gnueabi" "g++-arm-linux-gnueabihf" "g++-aarch64-linux-gnu" qemu-user-static | |
- name: Install PythonUtils & Deps | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
sudo apt-get install libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev xcb -y | |
pip install ansi2txt | |
pip install scons | |
pip install staticx | |
pip install pyinstaller | |
pip install py2static | |
pip install typer | |
continue-on-error: true | |
- name: Install CargoUtils & Deps | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
cargo install cross --git "https://github.com/cross-rs/cross" | |
continue-on-error: true | |
##Needed until gh runners updates go version: https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md | |
## It helps to be on bleeding edge anyway | |
- name: Install/Update golang | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
echo "yes" | bash <(curl -qfsSL "https://git.io/go-installer") | |
source "$HOME/.bashrc" | |
go version | |
continue-on-error: true | |
- name: Install Addons | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
#b3sum | |
sudo curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks/main/x86_64/b3sum" -o "/usr/bin/b3sum" && sudo chmod +xwr "/usr/bin/b3sum" | |
sudo curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks/main/x86_64/b3sum" -o "/usr/local/bin/b3sum" && sudo chmod +xwr "/usr/local/bin/b3sum" | |
#eget | |
curl -qfsSL "https://zyedidia.github.io/eget.sh" | bash | |
sudo mv ./eget* "/usr/local/bin/eget" | |
sudo chmod +xwr "/usr/local/bin/eget" | |
continue-on-error: true | |
- name: Install Crystal | |
run: | | |
#https://crystal-lang.org/install/on_ubuntu/ | |
curl -fsSL https://crystal-lang.org/install.sh | sudo bash | |
continue-on-error: true | |
- name: Install Meson & Ninja | |
run: | | |
#Presets | |
set -x ; set +e | |
#Install | |
sudo rm "/usr/bin/meson" "/usr/bin/ninja" 2>/dev/null | |
pip install meson ninja --upgrade | |
#python3 -m pip install meson ninja --upgrade | |
sudo ln -s "$HOME/.local/bin/meson" "/usr/bin/meson" 2>/dev/null | |
sudo ln -s "$HOME/.local/bin/ninja" "/usr/bin/ninja" 2>/dev/null | |
sudo chmod +xwr "/usr/bin/meson" "/usr/bin/ninja" | |
#version | |
meson --version ; ninja --version | |
continue-on-error: true | |
- name: Install 7z | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
cd $(mktemp -d) && curl -qfsSLJO "https://www.7-zip.org/$(curl -qfsSL "https://www.7-zip.org/download.html" | grep -o 'href="[^"]*"' | sed 's/href="//' | grep 'linux-x64.tar.xz' | sed 's/"$//' | sort | tail -n 1)" | |
find . -type f -name '*.xz' -exec tar -xf {} \; | |
#sudo rm $(which 7z) 2>/dev/null ; sudo rm $(which 7z) 2>/dev/null | |
sudo find . -type f -name '7zzs' ! -name '*.xz' -exec cp {} "/usr/local/bin/7z" \; | |
sudo chmod +xwr "/usr/local/bin/7z" | |
sudo find . -type f -name '7zzs' ! -name '*.xz' -exec cp {} "/usr/bin/7z" \; | |
sudo chmod +xwr "/usr/bin/7z" | |
7z -h | |
continue-on-error: true | |
- name: Install upX | |
run: | | |
cd $(mktemp -d) && curl -qfLJO "$(curl -qfsSL https://api.github.com/repos/upx/upx/releases/latest | jq -r '.assets[].browser_download_url' | grep -i 'amd64_linux')" | |
find . -type f -name '*tar*' -exec tar -xvf {} \; | |
sudo find . -type f -name 'upx' -exec mv {} "$(which upx)" \; | |
continue-on-error: true | |
- name: Setup Env | |
run: | | |
# Create Output Dir | |
mkdir -p "$GITHUB_WORKSPACE/main/aarch64_arm64" | |
- name: Download || Build Binaries | |
run: | | |
eget --rate | |
bash <(curl -qfsSL "https://raw.githubusercontent.com/Azathothas/Toolpacks/main/.github/scripts/eget_build_binaries_aarch64_arm64.sh") | |
continue-on-error: true | |
#------------------------------------------------------------------------------------# | |
- name: Update Binaries | |
run: | | |
#Copy to Repo | |
#Exclude copying bins > 100 MB | |
find "$HOME/bin" -maxdepth 1 -type f ! -size +99M -exec cp {} "$GITHUB_WORKSPACE/main/aarch64_arm64" \; | |
continue-on-error: true | |
- name: Strip || Cleanup | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
cd "$GITHUB_WORKSPACE/main/aarch64_arm64" | |
find "$GITHUB_WORKSPACE/main/aarch64_arm64/" -maxdepth 1 -type f -exec aarch64-linux-gnu-objcopy --preserve-dates --verbose --strip-all {} \; 2>/dev/null | |
# Strip && Rename anything with *_aarch64_arm64_Linux* | |
find "$GITHUB_WORKSPACE/main/aarch64_arm64" -type f -name '*_Linux' -exec sh -c 'newname=$(echo "$1" | sed "s/_aarch64_arm64_Linux//"); mv "$1" "$newname"' sh {} \; | |
continue-on-error: true | |
- name: Update README.md | |
run: | | |
#Presets | |
set -x ; set +e | |
#--------------# | |
cd "$GITHUB_WORKSPACE/main" | |
echo -e "" > "./aarch64_arm64/README.md" | |
echo '---' >> "./aarch64_arm64/README.md" | |
echo '```console' >> "./aarch64_arm64/README.md" | |
echo -e "" >> "./aarch64_arm64/README.md" | |
echo -e "--> METATDATA" >> "./aarch64_arm64/README.md" | |
/bin/bash -c 'PS4="$ "; file ./aarch64_arm64/* | grep -v '.txt' ' &>> "./aarch64_arm64/README.md" | |
echo -e "" >> ./aarch64_arm64/README.md | |
echo -e "--> BLAKE3SUM" >> ./aarch64_arm64/README.md | |
/bin/bash -c 'PS4="$ ";b3sum ./aarch64_arm64/* | grep -v '.txt' ' &>> "./aarch64_arm64/README.md" | |
/bin/bash -c 'PS4="$ ";b3sum ./aarch64_arm64/* | grep -v '.txt' ' &> "./aarch64_arm64/BLAKE3SUM" | |
echo -e "" >> ./aarch64_arm64/README.md | |
echo -e "--> SHA256SUM" >> "./aarch64_arm64/README.md" | |
/bin/bash -c 'PS4="$ ";sha256sum ./aarch64_arm64/* | grep -v '.txt' ' &>> "./aarch64_arm64/README.md" | |
/bin/bash -c 'PS4="$ ";sha256sum ./aarch64_arm64/* | grep -v '.txt' ' &> "./aarch64_arm64/SHA256SUM" | |
echo -e '```\n' >> "./aarch64_arm64/README.md" | |
echo -e "" >> "./aarch64_arm64/README.md" | |
echo '---' >> "./aarch64_arm64/README.md" | |
echo -e "" >> "./aarch64_arm64/README.md" | |
echo '- #### Sizes' >> "./aarch64_arm64/README.md" | |
echo -e "" >> "./aarch64_arm64/README.md" | |
echo '```console' >> "./aarch64_arm64/README.md" | |
/bin/bash -c 'PS4="$ ";ls -lh ./aarch64_arm64/* | grep -v '.txt' | awk "{print \$5, \$9}" | column -t' &>> "./aarch64_arm64/README.md" | |
echo -e "\n[+] Total Size: $(du -h ./aarch64_arm64 | awk '{print $1}')\n" | |
echo '```' >> "./aarch64_arm64/README.md" | |
echo -e "" >> "./aarch64_arm64/README.md" | |
echo '---' >> "./aarch64_arm64/README.md" | |
echo -e "" >> "./aarch64_arm64/README.md" | |
continue-on-error: true | |
- name: Git Pull | |
run: | | |
cd "$GITHUB_WORKSPACE/main" && git pull origin main | |
continue-on-error: true | |
- name: Get DateTime | |
run: | | |
# Date Time | |
NEPALI_TIME=$(TZ='Asia/Kathmandu' date +'%Y-%m-%d (%I:%M:%S %p)') | |
echo "NEPALI_TIME=$NEPALI_TIME" >> $GITHUB_ENV | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
repository: ./main | |
commit_user_name: Azathothas # defaults to "github-actions[bot]" | |
commit_user_email: [email protected] # defaults to "41898282+github-actions[bot]@users.noreply.github.com" | |
commit_message: "β ποΈ Fetch | Build βοΈ Weekly (aarch64_arm64) Package π¦ποΈ <-- ${{ env.NEPALI_TIME }} β" | |
#push_options: '--force' |