-
Notifications
You must be signed in to change notification settings - Fork 124
88 lines (77 loc) · 3.02 KB
/
ultroid.yml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Ultroid Workflow
on:
push:
workflow_dispatch:
env:
GitHubName: ${{ github.event.repository.owner.login }}
GitHubMail: ${{ github.event.repository.owner.login }}@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@main
- uses: styfle/cancel-workflow-action@0.9.1
name: "Cancel duplicate workflow runs"
with:
all_but_latest: true
access_token: ${{ github.token }}
- name: Initialize
continue-on-error: true
run: |
git config --global user.name ${GitHubName} && git config --global user.email ${GitHubMail}
git config --global credential.helper 'store --file $XDG_CONFIG_HOME/git/credentials'
[ -d "$XDG_CONFIG_HOME/git" ] && echo "" || mkdir $XDG_CONFIG_HOME/git
echo "https://${GitHubName}:${{ secrets.GH_TOKEN }}@github.com" > $XDG_CONFIG_HOME/git/credentials
sudo hostnamectl set-hostname errored-af
# Add PPA for python3.9 or python3.9+
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
- name: Cache apt packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: bash cmake curl ffmpeg gcc git jq make mediainfo megatools neofetch wkhtmltopdf zip software-properties-common python3.10 python3.10-dev
version: 1.0
- name: Load Config file
continue-on-error: false
run: |
if [ -z "${{ secrets.CREDS }}" ]; then
echo "CREDS is empty"
exit 1
fi
case ${{ secrets.CREDS }} in
(*gist.github*)
if [ ! -d ultroid ]; then
mkdir ultroid
fi
curl -L ${{ secrets.CREDS }} > ultroid/.env
;;
(*raw.githubusercontent*)
if [ ! -d ultroid ]; then
mkdir ultroid
fi
curl -L ${{ secrets.CREDS }} > ultroid/.env
;;
(*//github.com/*)
git clone ${{ secrets.CREDS }} ultroid
esac
if [ ! -f ultroid/.env ]; then
echo "No .env file found"
exit 1
fi
- name: Install Ultroid
continue-on-error: false
run: wget https://raw.githubusercontent.com/TeamUltroid/Ultroid/dev/installer.sh && chmod +x installer.sh && sudo bash installer.sh --dir="/root/TeamUltroid" --branch=dev --env-file="ultroid/.env"
- name: Run Ultroid
continue-on-error: false
run: sudo bash action.sh
- name: Loop workflow
continue-on-error: false
run: |
git clone https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} loop
cd loop || exit 1
echo $(date -u +%T%P) >> loop.txt
git add loop.txt
git commit -m "Workflow : Loop $(date -u +%D-%T%P)"
git push -q https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} HEAD:main