Update Sources #1106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |