From ac63ad48c6b91cb0af8669c60db6217a65bae669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Barroso=20Galindo?= Date: Sun, 20 Nov 2022 01:14:20 +0100 Subject: [PATCH] Splitting update step into 3 steps. --- .github/calculate_db.py | 2 +- .github/commit_distribution.sh | 21 +++++++++++++++++++++ .github/workflows/update_distribution.yml | 14 +++++++++----- 3 files changed, 31 insertions(+), 6 deletions(-) create mode 100755 .github/commit_distribution.sh diff --git a/.github/calculate_db.py b/.github/calculate_db.py index 8929b466e..320735444 100755 --- a/.github/calculate_db.py +++ b/.github/calculate_db.py @@ -520,7 +520,7 @@ def create_db(folder, options, tags): run_succesfully('git push origin zips_backup || true') run_succesfully('git push origin --delete zips || true') run_succesfully('git push origin new_zips:zips') - run_succesfully('git push origin --delete zips_backup') + run_succesfully('git push origin --delete zips_backup || true') else: print('Using old zip branch from origin') zip_sha = run_stdout('git rev-parse --verify origin/zip').strip() diff --git a/.github/commit_distribution.sh b/.github/commit_distribution.sh new file mode 100755 index 000000000..1cd5f232b --- /dev/null +++ b/.github/commit_distribution.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Copyright (c) 2022 José Manuel Barroso Galindo + +set -euo pipefail + +git config --global user.email "theypsilon@gmail.com" +git config --global user.name "The CI/CD Bot" +git checkout -f develop -b main +echo "Running detox" +detox -v -s utf_8-only -r * +echo "Detox done" +echo "Removing colons" +IFS=$'\n' +for i in $(find . -name "*:*"); do + echo mv "${i}" "${i/:/-}" + mv "${i}" "${i/:/-}" +done +echo "Colons removed" +git add . +git commit -m "-" +git fetch origin main || true diff --git a/.github/workflows/update_distribution.yml b/.github/workflows/update_distribution.yml index 23d5b4a49..56993c6e8 100644 --- a/.github/workflows/update_distribution.yml +++ b/.github/workflows/update_distribution.yml @@ -30,7 +30,13 @@ jobs: cd .github/tests ./test_calculate_db.py - - name: Update Distribution + - name: Download Distribution + run: ./.github/update_distribution.sh . + + - name: Commit Distribution + run: ./.github/commit_distribution.sh + + - name: Calculate and Push Database run: | set -euo pipefail git config --global user.email "theypsilon@gmail.com" @@ -43,9 +49,7 @@ jobs: export ZIPS_CONFIG=./.github/zips_config.json export LINUX_GITHUB_REPOSITORY=MiSTer-devel/SD-Installer-Win64_MiSTer - - ./.github/update_distribution.sh . --push + ./.github/calculate_db.py env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file