-
Notifications
You must be signed in to change notification settings - Fork 1
157 lines (138 loc) · 5.15 KB
/
sources.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: Update Sources
on:
schedule:
- cron: "0 0,12 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: |
sudo apt update
sudo apt install libplist-utils xmlstarlet libxml2-utils jq curl git zip unzip xz-utils zstd gzip bzip2 -y
git config --global user.name "AltStore Sources"
git config --global user.email actions@github.com
git clone https://github.com/Al4ise/Azule ${{ github.workspace }}/Azule
ln -sf ${{ github.workspace }}/Azule/azule ${{ github.workspace }}/uYouPlus/azule
ln -sf ${{ github.workspace }}/Azule/azule ${{ github.workspace }}/uYouPlusExtra/azule
ln -sf ${{ github.workspace }}/Azule/azule ${{ github.workspace }}/YTiVanced/azule
npm i
# cd EnmityCustomIcons
# npm i
- name: Build scripts
run: |
tsc
# Disable Enmity Custom Icons as it is outdated and causes errors
# - name: Update Enmity Custom Icons
# run: |
# cd EnmityCustomIcons
# node enmityCustomIcons.js
- name: Compare uYouPlus version
id: compare_uyouplus
run: |
remote=$(curl -s https://api.github.com/repos/qnblackcat/uYouPlus/releases/latest | jq -r '.tag_name' | grep -oP 'v\K(.*?)(?=-)')
json=$(sed '5q;d' uYouPlus/uyouplus.json)
version=$(echo $json | jq -r '.apps[0].version')
echo "Remote version: $remote"
echo "Current version: $version"
echo "uyouplus_remote=$remote" >> $GITHUB_ENV
echo "uyouplus_current=$version" >> $GITHUB_ENV
if [ "$remote" != "$version" ]; then
echo "Update available"
else
echo "No update available"
fi
- name: Compare uYouPlusExtra version
id: compare_uyouplusextra
run: |
cd uYouPlusExtra/
versions=$(node check.js | jq)
update=$(echo $versions | jq -r '.update')
remote=$(echo $versions | jq -r '.remote')
echo "Remote version: $remote"
if [ "$update" = "true" ]
then
echo "Update available"
echo "uyouplusextra_remote=$remote" >> $GITHUB_ENV
else
echo "No update available"
fi
echo "uyouplusextra_update=$update" >> $GITHUB_ENV
- name: Compare YTiVanced version
id: compare_ytivanced
run: |
cd YTiVanced/
versions=$(node check.js | jq)
update=$(echo $versions | jq -r '.update')
remote=$(echo $versions | jq -r '.remote')
echo "Remote version: $remote"
if [ "$update" = "true" ]
then
echo "Update available"
echo "ytivanced_remote=$remote" >> $GITHUB_ENV
else
echo "No update available"
fi
echo "ytivanced_update=$update" >> $GITHUB_ENV
- name: Update uYouPlus
id: update_uyouplus
if: env.uyouplus_remote != env.uyouplus_current
run: |
cd uYouPlus
bash run.sh
- name: Update uYouPlusExtra
id: update_uyouplusextra
if: ${{ env.uyouplusextra_update == 'true' }}
run: |
cd uYouPlusExtra
node update.js
- name: Update YTiVanced
id: update_ytivanced
if: ${{ env.ytivanced_update == 'true' }}
run: |
cd YTiVanced
node update.js
- name: Commit changes
run: |
git add .
git diff-index --quiet HEAD || (git commit -m "Update sources" && git push)
- name: Create Release for uYouPlus
if: env.uyouplus_remote != env.uyouplus_current
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "${{ github.workspace }}/uYouPlus/Out/*"
makeLatest: true
name: "uYouPlus ${{ env.uyouplus_remote }}"
token: ${{ secrets.GITHUB_TOKEN }}
tag: "uyouplus-${{ env.uyouplus_remote }}"
- name: Create Release for uYouPlusExtra
if: ${{ env.uyouplusextra_update == 'true' }}
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
artifacts: "${{ github.workspace }}/uYouPlusExtra/Out/*"
makeLatest: true
name: "uYouPlusExtra ${{ env.uyouplusextra_remote }}"
token: ${{ secrets.GITHUB_TOKEN }}
tag: "uyouplusextra-${{ env.uyouplusextra_remote }}"
- name: Create Release for YTiVanced
if: ${{ env.ytivanced_update == 'true' }}
uses: ncipollo/release-action@v1.12.0
with:
allowUpdates: true
artifacts: "${{ github.workspace }}/YTiVanced/Out/*"
makeLatest: true
name: "YouTube iVanced ${{ env.ytivanced_remote }}"
token: ${{ secrets.GITHUB_TOKEN }}
tag: "ytivanced-${{ env.ytivanced_remote }}"