Automatically get Youtube version from the ipa itself (#100)

* See what's inside an unpacked .ipa

* cat the plist that has the info which yt version we're getting

* extract the version and see how available the variable is

* Use yt_version variable in build process

* single quote also the first sed to avoid double quoting

* Update buildapp.yml

* Update buildapp.yml

* Update buildapp.yml

* Update buildapp.yml

* try it this way?

* the grand final!

* Use Info.plist within ipa to determin yt version instead
This commit is contained in:
Macley
2024-03-18 11:27:35 +01:00
committed by GitHub
parent b70f981c7e
commit 3b64ad3aba

View File

@@ -11,11 +11,6 @@ on:
default: ""
required: true
type: string
youtube_version:
description: "The version of YouTube"
default: ""
required: true
type: string
ytliteplus_version:
description: "The version of YTLitePlus"
default: "3.0.1"
@@ -103,16 +98,13 @@ jobs:
- name: Prepare YouTube iPA
run: |
wget "$YOUTUBE_URL" --no-verbose -O main/YouTube.ipa
echo -e "==> \033[1mYouTube v${{ inputs.youtube_version }} downloaded! \033[0m"
unzip -q main/YouTube.ipa -d main/tmp
echo "YT_VERSION=$(grep -A 1 '<key>CFBundleVersion</key>' main/tmp/Payload/YouTube.app/Info.plist | grep '<string>' | awk -F'[><]' '{print $3}')" >> $GITHUB_ENV
rm -rf main/tmp/Payload/YouTube.app/_CodeSignature/CodeResources
rm -rf main/tmp/Payload/YouTube.app/PlugIns/*
cp -R main/Extensions/*.appex main/tmp/Payload/YouTube.app/PlugIns
echo -e "==> \033[1mYouTube v${{ inputs.youtube_version }} unpacked! \033[0m"
env:
THEOS: ${{ github.workspace }}/theos
YOUTUBE_VERSION: ${{ inputs.youtube_version }}
YOUTUBE_URL: ${{ inputs.decrypted_youtube_url }}
- name: Fix Compiling & Build Package
@@ -123,16 +115,15 @@ jobs:
cd ${{ github.workspace }}/main
sed -i '' "12s#.*#BUNDLE_ID = ${{ env.BUNDLE_ID }}#g" Makefile
sed -i '' "11s#.*#DISPLAY_NAME = ${{ env.APP_NAME }}#g" Makefile
sed -i '' "s/^PACKAGE_VERSION.*$/PACKAGE_VERSION = ${{ inputs.youtube_version }}-${{ inputs.ytliteplus_version }}/" Makefile
sed -i '' "s/^PACKAGE_VERSION.*$/PACKAGE_VERSION = ${{ env.YT_VERSION }}-${{ inputs.ytliteplus_version }}/" Makefile
make package FINALPACKAGE=1
(mv "packages/$(ls -t packages | head -n1)" "packages/YTLitePlus_${{ env.YOUTUBE_VERSION }}_${{ env.ytliteplus_version }}.ipa")
(mv "packages/$(ls -t packages | head -n1)" "packages/YTLitePlus_${{ env.YT_VERSION }}_${{ env.ytliteplus_version }}.ipa")
echo "package=$(ls -t packages | head -n1)" >>$GITHUB_OUTPUT
echo -e "==> \033[1mSHASUM256: $(shasum -a 256 packages/*.ipa | cut -f1 -d' ')\033[0m"
echo -e "==> \033[1mBundle ID: ${{ env.BUNDLE_ID }}\033[0m"
env:
THEOS: ${{ github.workspace }}/theos
ytliteplus_version: ${{ inputs.ytliteplus_version }}
YOUTUBE_VERSION: ${{ inputs.youtube_version }}
BUNDLE_ID: ${{ inputs.bundle_id }}
APP_NAME: ${{ inputs.app_name }}
@@ -140,16 +131,15 @@ jobs:
uses: actions/upload-artifact@v4.3.1
env:
ytliteplus_version: ${{ inputs.ytliteplus_version }}
YOUTUBE_VERSION: ${{ inputs.youtube_version }}
with:
name: YTLitePlus_${{ env.YOUTUBE_VERSION }}_${{ env.ytliteplus_version }}
name: YTLitePlus_${{ env.YT_VERSION }}_${{ env.ytliteplus_version }}
path: ${{ github.workspace }}/main/packages/${{ steps.build_package.outputs.package }}
if-no-files-found: error
- name: Prepare Release Notes
run: |
export TODAY=$(date '+%Y-%m-%d')
sed "s/%ytliteplus_version%/${{ inputs.ytliteplus_version }}/g; s/%youtube_version%/${{ inputs.youtube_version }}/g; s/%date%/$TODAY/g" \
sed "s/%ytliteplus_version%/${{ inputs.ytliteplus_version }}/g; s/%youtube_version%/${{ env.YT_VERSION }}/g; s/%date%/$TODAY/g" \
main/.github/RELEASE_TEMPLATE/Release.md > ${{ github.workspace }}/release_notes.md
- name: Create Release
@@ -158,11 +148,10 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ytliteplus_version: ${{ inputs.ytliteplus_version }}
YOUTUBE_VERSION: ${{ inputs.youtube_version }}
DRAFT: ${{ inputs.create_release }}
with:
tag_name: v${{ env.YOUTUBE_VERSION }}-${{ env.ytliteplus_version }}
name: v${{ env.YOUTUBE_VERSION }}-${{ env.ytliteplus_version }} - YTLitePlus
tag_name: v${{ env.YT_VERSION }}-${{ env.ytliteplus_version }}
name: v${{ env.YT_VERSION }}-${{ env.ytliteplus_version }} - YTLitePlus
files: main/packages/*.ipa
draft: ${{ env.DRAFT }}
body_path: ${{ github.workspace }}/release_notes.md