Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gouravkhunger committed Jun 7, 2024
0 parents commit 7a6fad0
Show file tree
Hide file tree
Showing 3 changed files with 144 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/build-bootstraps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Adapted from
# https://github.com/termux/termux-packages/blob/master/.github/workflows/bootstrap_archives.yml

name: Build bootstraps

on:
- workflow_dispatch

jobs:
build:
runs-on: ubuntu-latest

env:
ANDROID_HOME: "/opt/termux/android-sdk"
NDK: "/opt/termux/android-ndk"

strategy:
matrix:
target_arch: [aarch64, arm, i686, x86_64]

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Get packages from termux-packages
uses: actions/checkout@v4
with:
repository: termux/termux-packages
path: termux-packages
fetch-depth: 1

- name: Apply patches
run: |
mv patches/termux-packages/*.patch termux-packages
cd termux-packages
git apply *.patch
- name: Create bootstrap archive
working-directory: ./termux-packages
run: |
./scripts/run-docker.sh ./clean.sh
./scripts/run-docker.sh ./scripts/build-bootstraps.sh --android10 --architectures ${{ matrix.target_arch }}
- name: Store bootstrap
uses: actions/upload-artifact@v4
with:
name: bootstrap-${{ matrix.target_arch }}
path: "./termux-packages/*.zip"

publish:
permissions:
contents: write # for git push
needs: build
runs-on: ubuntu-latest
steps:
- name: Git clone
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch bootstrap archives
uses: actions/download-artifact@v4
with:
merge-multiple: true
path: ./
- name: Create new tag
id: get_tag
run: |
new_tag="bootstrap-$(date "+%Y.%m.%d")"
existing_tag_revision=$(git tag | grep "$new_tag" | sort -r | head -n 1 | cut -d- -f3 | cut -dr -f2)
if [ -n "$existing_tag_revision" ]; then
tag_rev=$((existing_tag_revision + 1))
else
tag_rev=1
fi
new_tag="${new_tag}-r${tag_rev}"
git tag "$new_tag"
git push --tags
echo "tag_name=$new_tag" >> $GITHUB_OUTPUT
- name: Publish bootstrap zips to GitHub release
uses: termux/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "*.zip"
file_glob: true
release_name: "Bootstrap archives for Termux application"
tag: ${{ steps.get_tag.outputs.tag_name }}
checksums: sha256,sha512,md5
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Android 10 Ruby Termux Demo
54 changes: 54 additions & 0 deletions patches/termux-packages/build-bootstraps.sh.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
diff --git a/scripts/build-bootstraps.sh b/scripts/build-bootstraps.sh
index 906ef1318..efd59b861 100755
--- a/scripts/build-bootstraps.sh
+++ b/scripts/build-bootstraps.sh
@@ -396,48 +396,8 @@ main() {
PACKAGES=()
EXTRACTED_PACKAGES=()

- # Package manager.
- if ! ${BOOTSTRAP_ANDROID10_COMPATIBLE}; then
- PACKAGES+=("apt")
- fi
-
# Core utilities.
- PACKAGES+=("bash")
- PACKAGES+=("bzip2")
- if ! ${BOOTSTRAP_ANDROID10_COMPATIBLE}; then
- PACKAGES+=("command-not-found")
- else
- PACKAGES+=("proot")
- fi
- PACKAGES+=("coreutils")
- PACKAGES+=("curl")
- PACKAGES+=("dash")
- PACKAGES+=("diffutils")
- PACKAGES+=("findutils")
- PACKAGES+=("gawk")
- PACKAGES+=("grep")
- PACKAGES+=("gzip")
- PACKAGES+=("less")
- PACKAGES+=("procps")
- PACKAGES+=("psmisc")
- PACKAGES+=("sed")
- PACKAGES+=("tar")
- PACKAGES+=("termux-exec")
- PACKAGES+=("termux-keyring")
- PACKAGES+=("termux-tools")
- PACKAGES+=("util-linux")
- PACKAGES+=("xz-utils")
-
- # Additional.
- PACKAGES+=("ed")
- PACKAGES+=("debianutils")
- PACKAGES+=("dos2unix")
- PACKAGES+=("inetutils")
- PACKAGES+=("lsof")
- PACKAGES+=("nano")
- PACKAGES+=("net-tools")
- PACKAGES+=("patch")
- PACKAGES+=("unzip")
+ PACKAGES+=("ruby")

# Handle additional packages.
for add_pkg in "${ADDITIONAL_PACKAGES[@]}"; do

0 comments on commit 7a6fad0

Please sign in to comment.