-
Notifications
You must be signed in to change notification settings - Fork 20
66 lines (52 loc) · 1.87 KB
/
update_distribution.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Update Distribution
on:
schedule:
- cron: "*/20 * * * *"
push:
branches:
- develop
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-22.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_FILES_URL: https://raw.githubusercontent.com/MiSTer-devel/Distribution_MiSTer/%s/
DB_JSON_NAME: db.json
DB_ID: distribution_mister
DB_URL: https://raw.githubusercontent.com/MiSTer-devel/Distribution_MiSTer/main/db.json.zip
ZIPS_CONFIG: ./.github/zips_config.json
LINUX_GITHUB_REPOSITORY: MiSTer-devel/SD-Installer-Win64_MiSTer
BROKEN_MRAS_IGNORE: true
steps:
- uses: actions/checkout@v3
with:
ref: develop
- name: Install apt-get utilities
run: sudo apt-get install sharutils
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Set Git User
run: |
git config --global user.email "[email protected]"
git config --global user.name "The CI/CD Bot"
- name: Assert develop files amount to be less than 1000
run: set -exo pipefail && (( $(find . -type f | wc -l) < 1000 ))
- name: Download Distribution files
run: ./.github/download_distribution.py .
- name: Assert Distribution files amount to be over 13000
run: set -exo pipefail && (( $(find . -type f | wc -l) > 13000 ))
- name: Commit Distribution files
run: ./.github/commit_distribution.sh
- name: Build Database
run: ./.github/db_operator.py build .
- name: New Database Exists?
id: db_exists
run: if [ -f "${DB_JSON_NAME}" ] ; then echo "new_db=true" >> "${GITHUB_OUTPUT}" ; fi
- name: Test Database
if: steps.db_exists.outputs.new_db == 'true'
run: ./.github/test_database.sh
- name: Push Database
if: steps.db_exists.outputs.new_db == 'true'
run: ./.github/push_database.sh