-
Notifications
You must be signed in to change notification settings - Fork 17
67 lines (57 loc) · 2.69 KB
/
list_termux_pkgs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: 💾 Fetch || ⏫ Update Termux Package Registry 📦
#MAX_RUNTIME: ~ 03 mins
on:
workflow_dispatch:
schedule:
- cron: "0 */12 * * *" # Every 12 Hrs
jobs:
fetch:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: main
- name: Setup Env
run: |
# Create Output Dir
mkdir -p "$GITHUB_WORKSPACE/main/Info/Packages/Termux"
- name: Fetch || Update Termux Package Registry (Docker --> termux/termux-docker)
run: |
docker run --privileged --name termux \
termux/termux-docker:latest \
bash -c 'apt-get clean && apt-get update; for pkg in $(apt-cache pkgnames | sort -u); do version=$(apt-cache show $pkg | grep -m 1 "Version:" | cut -c 10-); description=$(apt-cache show $pkg | grep -m 1 "Description:" | cut -c 14-); homepage=$(apt-cache show $pkg | grep -m 1 "Homepage:" | cut -c 11-); echo "| **$pkg** | $version | $description | $homepage |"; done > termux.pkgs'
#Copy
docker cp "termux:/data/data/com.termux/files/home/termux.pkgs" "$GITHUB_WORKSPACE/main/Info/Packages/Termux/termux.pkgs"
continue-on-error: false
- name: Update README.md
run: |
cd "$GITHUB_WORKSPACE/main"
echo -e "" > "./Info/Packages/Termux/README.md"
echo '---' >> "./Info/Packages/Termux/README.md"
echo "|Package | Version | Description | Homepage |" >> "./Info/Packages/Termux/README.md"
echo "|--------|---------|-------------|----------|" >> "./Info/Packages/Termux/README.md"
cat "./Info/Packages/Termux/termux.pkgs" >> "./Info/Packages/Termux/README.md"
echo -e "" >> "./Info/Packages/Termux/README.md"
echo '---' >> "./Info/Packages/Termux/README.md"
working-directory: main
continue-on-error: false
- 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
- name: Git Pull
run: |
cd "$GITHUB_WORKSPACE/main" && git pull origin main
continue-on-error: true
#Commit & Push
- 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: "✅ Update Termux pkg Registry 📦 <-- ${{ env.NEPALI_TIME }} ⌚"
#push_options: '--force'