Skip to content

Commit 5cdbc2c

Browse files
nullactions-user
null
authored andcommitted
Build f30319ff7cb3cdaa34207171c5f691f198e3430c
0 parents  commit 5cdbc2c

27 files changed

+49
-0
lines changed

.github/clean.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import requests
2+
import glob
3+
import os
4+
5+
REPO = "recloudstream/cloudstream"
6+
LIMIT = 30
7+
MARKERS = ['<!--begin table-->', '<!--end table-->']
8+
9+
r = requests.get(f"https://api.github.com/repos/{REPO}/commits?per_page={LIMIT}")
10+
commits = {}
11+
for commit in r.json():
12+
short = commit['sha'][:7]
13+
commits[short] = commit
14+
15+
for apk in glob.glob("*.apk"):
16+
sha, _ = apk.split(".")
17+
if sha not in commits.keys():
18+
os.remove(apk)

.github/workflows/clean.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Clean archive
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: "clean"
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Run script
18+
run: |
19+
python3 .github/clean.py
20+
21+
- name: Push archive
22+
run: |
23+
git config --local user.email "[email protected]"
24+
git config --local user.name "GitHub Actions"
25+
git add .
26+
git commit --amend -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit
27+
git push --force

0 commit comments

Comments
 (0)