diff --git a/.github/workflows/cooker-selfhosted.yml b/.github/workflows/cooker-selfhosted.yml index debbfb76..f10f4b27 100644 --- a/.github/workflows/cooker-selfhosted.yml +++ b/.github/workflows/cooker-selfhosted.yml @@ -62,11 +62,6 @@ jobs: runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/22.08 /bin/bash ${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh # Run pre-build automation tasks - - name: Setting branch in the manifest - run: | - sed -i "s/THISBRANCH/$(git rev-parse --abbrev-ref HEAD)/g" net.retrodeck.retrodeck.yml - echo "Branch name is: $(git rev-parse --abbrev-ref HEAD)" - - name: Build flatpak run: | git config --global protocol.file.allow always @@ -117,4 +112,4 @@ jobs: with: name: retrodeck-flatpak path: RetroDECK.flatpak - continue-on-error: true \ No newline at end of file + continue-on-error: true diff --git a/.github/workflows/main-selfhosted.yml b/.github/workflows/main-selfhosted.yml index 7cd7e44f..47381d0d 100644 --- a/.github/workflows/main-selfhosted.yml +++ b/.github/workflows/main-selfhosted.yml @@ -53,11 +53,6 @@ jobs: runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/22.08 /bin/bash ${GITHUB_WORKSPACE}/automation_tools/pre_build_automation.sh # Run pre-build automation tasks - - name: Setting branch in the manifest - run: | - sed -i "s/branch: THISBRANCH/branch: $(git rev-parse --abbrev-ref HEAD)/g" net.retrodeck.retrodeck.yml - echo "Branch name is: $(git rev-parse --abbrev-ref HEAD)" - - name: Read manifest content id: read_manifest run: echo "::set-output name=file_content::$(cat net.retrodeck.retrodeck.yml)" diff --git a/automation_tools/automation_task_list.cfg b/automation_tools/automation_task_list.cfg index f1624f43..98321389 100644 --- a/automation_tools/automation_task_list.cfg +++ b/automation_tools/automation_task_list.cfg @@ -1,5 +1,6 @@ # The proper format for this file is # ACTION^PLACEHOLDERTEXT^URL^REPO(Optional) +branch^THISBRANCH # hash^DOOMSHAPLACEHOLDER^https://buildbot.libretro.com/assets/cores/DOOM/Doom%20%28Shareware%29.zip hash^VITASHAPLACEHOLDER^https://github.com/Vita3K/Vita3K/releases/download/continuous/ubuntu-latest.zip hash^DUCKSTATIONSHAPLACEHOLDER^https://github.com/stenzek/duckstation/releases/download/preview/DuckStation-x64.AppImage diff --git a/automation_tools/pre_build_automation.sh b/automation_tools/pre_build_automation.sh index 637c3f95..f4d56c62 100644 --- a/automation_tools/pre_build_automation.sh +++ b/automation_tools/pre_build_automation.sh @@ -15,6 +15,7 @@ rd_manifest=${GITHUB_WORKSPACE}/net.retrodeck.retrodeck.yml automation_task_list=${GITHUB_WORKSPACE}/automation_tools/automation_task_list.cfg +current_branch=$(git rev-parse --abbrev-ref HEAD) echo "Manifest location: $rd_manifest" echo "Automation task list location: $automation_task_list" @@ -23,10 +24,17 @@ echo "Task list contents:" cat "$automation_task_list" echo +# Update all collected information while IFS="^" read -r action placeholder url branch do if [[ ! $action == "#"* ]] && [[ ! -z "$action" ]]; then - if [[ "$action" == "hash" ]]; then + if [[ "$action" == "branch" ]]; then + echo + echo "Placeholder text: $placeholder" + echo "Current branch:" "$current_branch" + echo + /bin/sed -i 's^'"$placeholder"'^'"$current_branch"'^g' $rd_manifest + elif [[ "$action" == "hash" ]]; then echo echo "Placeholder text: $placeholder" echo "URL to hash: $url"