Skip to content

Commit

Permalink
Build 984daeb3a26dfd00c4812cab45e8b76d06445acc
Browse files Browse the repository at this point in the history
  • Loading branch information
null authored and actions-user committed Aug 31, 2024
0 parents commit 9fe2df2
Show file tree
Hide file tree
Showing 26 changed files with 49 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/clean.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import requests
import glob
import os

REPO = "recloudstream/cloudstream"
LIMIT = 30
MARKERS = ['<!--begin table-->', '<!--end table-->']

r = requests.get(f"https://api.github.com/repos/{REPO}/commits?per_page={LIMIT}")
commits = {}
for commit in r.json():
short = commit['sha'][:7]
commits[short] = commit

for apk in glob.glob("*.apk"):
sha, _ = apk.split(".")
if sha not in commits.keys():
os.remove(apk)
27 changes: 27 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Clean archive

on:
push:
branches: [ master ]
workflow_dispatch:

concurrency:
group: "clean"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run script
run: |
python3 .github/clean.py
- name: Push archive
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add .
git commit --amend -m "Build $GITHUB_SHA" || exit 0 # do not error if nothing to commit
git push --force
Loading

0 comments on commit 9fe2df2

Please sign in to comment.