-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
40df448
commit 9671fb4
Showing
81 changed files
with
7,843 additions
and
125 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) 2022 José Manuel Barroso Galindo <[email protected]> | ||
|
||
set -euo pipefail | ||
|
||
if ! gh release list | grep -q "latest" ; then | ||
gh release create "latest" || true | ||
sleep 15s | ||
fi | ||
|
||
zip "update_all.zip" update_all.sh | ||
gh release upload "latest" "update_all.zip" --clobber |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) 2022 José Manuel Barroso Galindo <[email protected]> | ||
|
||
set -euo pipefail | ||
|
||
git add dont_download2.sh | ||
git commit -m "BOT: New dont_download2.sh" > /dev/null 2>&1 || true | ||
git fetch origin main | ||
|
||
set +e | ||
CHANGES="$(git diff main:dont_download2.sh origin/main:dont_download2.sh | sed '/^[+-]export COMMIT/d' | sed '/^+++/d' | sed '/^---/d' | grep '^[+-]' | wc -l)" | ||
set -e | ||
|
||
if [ ${CHANGES} -ge 1 ] ; then | ||
echo "There are changes to push." | ||
echo | ||
git push origin main | ||
echo | ||
echo "New dont_download2.sh can be used." | ||
echo "::set-output name=NEW_RELEASE::yes" | ||
else | ||
echo "Nothing to be updated." | ||
echo "::set-output name=NEW_RELEASE::no" | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: All Tests | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Install sharutils | ||
run: sudo apt-get install sharutils | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Unit Tests | ||
run: cd src && python3 -m unittest discover -s test/unit | ||
|
||
- name: Integration Tests | ||
run: cd src && python3 -m unittest discover -s test/integration | ||
|
||
- name: System Quick Tests | ||
run: cd src && python3 -m unittest discover -s test/system/quick | ||
|
||
- name: System Slow Tests | ||
run: cd src && python3 -m unittest discover -s test/system/slow |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Install sharutils | ||
run: sudo apt-get install sharutils | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Unit Tests | ||
run: cd src && python3 -m unittest discover -s test/unit | ||
|
||
- name: Integration Tests | ||
run: cd src && python3 -m unittest discover -s test/integration | ||
|
||
- name: System Tests | ||
run: cd src && python3 -m unittest discover -s test/system | ||
|
||
- name: Build | ||
run: ./src/build.sh > dont_download2.sh | ||
|
||
- name: Release | ||
id: release | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "The CI/CD Bot" | ||
./.github/release.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Pack Launcher | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'update_all.sh' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pack: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Pack Launcher | ||
run: ./.github/pack_launcher.sh | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
downloader.ini | ||
delme | ||
.venv | ||
.idea | ||
__pycache__ | ||
mister.ip |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright (c) 2022 José Manuel Barroso Galindo <[email protected]> | ||
|
||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
|
||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
|
||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
# You can download the latest version of this tool from: | ||
# https://github.com/theypsilon/Update_All_MiSTer | ||
|
||
import os | ||
from update_all.main import main | ||
from update_all.constants import DEFAULT_CURL_SSL_OPTIONS, \ | ||
DEFAULT_COMMIT, KENV_CURL_SSL, KENV_COMMIT, KENV_LOCATION_STR, DEFAULT_LOCATION_STR, KENV_DEBUG, DEFAULT_DEBUG | ||
|
||
if __name__ == '__main__': | ||
exit_code = main({ | ||
KENV_CURL_SSL: os.getenv(KENV_CURL_SSL, DEFAULT_CURL_SSL_OPTIONS), | ||
KENV_COMMIT: os.getenv(KENV_COMMIT, DEFAULT_COMMIT), | ||
KENV_LOCATION_STR: os.getenv(KENV_LOCATION_STR, DEFAULT_LOCATION_STR), | ||
KENV_DEBUG: os.getenv(KENV_DEBUG, DEFAULT_DEBUG) | ||
}) | ||
|
||
exit(exit_code) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) 2022 José Manuel Barroso Galindo <[email protected]> | ||
|
||
set -euo pipefail | ||
|
||
echo "Type checks:" | ||
python3 -m mypy src | ||
echo | ||
|
||
cd src | ||
echo "Unit Tests:" | ||
python3 -m unittest discover -s test/unit | ||
echo | ||
echo "Integration Tests:" | ||
python3 -m unittest discover -s test/integration | ||
echo | ||
echo "SystemTests:" | ||
python3 -m unittest discover -s test/system | ||
echo | ||
echo "Done" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) 2022 José Manuel Barroso Galindo <[email protected]> | ||
|
||
set -euo pipefail | ||
|
||
TEMP_ZIP1="$(mktemp -u).zip" | ||
TEMP_ZIP2="$(mktemp -u).zip" | ||
BIN="/tmp/dont_download.zip" | ||
UUDECODE_CMD=$({ [[ "${MISTER:-false}" == "false" ]] && [[ "$(uname -s)" == "Darwin" ]] ; } && echo "uudecode -p" || echo "uudecode -o -") | ||
EXPORTS="export COMMIT=$(git rev-parse --short HEAD)" | ||
|
||
if [[ "${DEBUG:-false}" == "true" ]] ; then | ||
EXPORTS="${EXPORTS}"$'\n'"export DEBUG=true" | ||
fi | ||
|
||
pin_metadata() { | ||
touch -a -m -t 202108231405 "${1}" | ||
} | ||
|
||
cd src | ||
|
||
find update_all -type f -iname "*.py" -print0 | while IFS= read -r -d '' file ; do pin_metadata "${file}" ; done | ||
pin_metadata __main__.py | ||
zip -q -0 -D -X -A -r "${TEMP_ZIP1}" __main__.py update_all -x "*/__pycache__/*" | ||
pin_metadata "${TEMP_ZIP1}" | ||
echo '#!/usr/bin/env python3' | cat - "${TEMP_ZIP1}" > "${TEMP_ZIP2}" | ||
pin_metadata "${TEMP_ZIP2}" | ||
rm "${TEMP_ZIP1}" | ||
cd .. | ||
|
||
cat <<-EOF | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
${EXPORTS} | ||
${UUDECODE_CMD} "\${0}" | xzcat -d -c > "${BIN}" | ||
chmod a+x "${BIN}" | ||
"${BIN}" "\${1:-}" | ||
exit 0 | ||
EOF | ||
|
||
uuencode - < <(xzcat -z < "${TEMP_ZIP2}") | ||
rm "${TEMP_ZIP2}" > /dev/null 2>&1 || true |
Oops, something went wrong.