-
Notifications
You must be signed in to change notification settings - Fork 25
75 lines (60 loc) · 2.39 KB
/
Copy pathupdate-progress.yml
File metadata and controls
75 lines (60 loc) · 2.39 KB
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
67
68
69
70
71
72
73
74
75
name: Update Progress
on:
push:
branches:
- main
jobs:
update-progress:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [1.12.1920.0]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install protobuf capstone colorama cxxfilt pyelftools ansiwrap watchdog python-Levenshtein toml gitpython
- name: Generate progress CSV
run: python tools/common/progress.py -c > progress.csv
- name: Generate report
run: |
PYTHONPATH="${PYTHONPATH}:${{ github.workspace }}/tools" python .github/scripts/gen_report.py -o report.json
- name: Checkout progress repository
uses: actions/checkout@v3
with:
repository: GRAnimated/MinecraftLCE-docs
token: ${{ secrets.PROGRESS_REPO_TOKEN }}
path: MinecraftLCE-docs
- name: Copy CSV to progress repository
run: cp progress.csv MinecraftLCE-docs/
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.version }}_report
path: report.json
- name: Update repository description
run: |
IFS=',' read -r version timestamp git_hash num_total code_size_total matching_count matching_code_size equivalent_count equivalent_code_size non_matching_count non_matching_code_size < progress.csv
total_count=$((matching_count + equivalent_count + non_matching_count))
progress_percentage=$(awk "BEGIN {printf \"%.3f\", ($total_count / $num_total) * 100}")
description="${progress_percentage}% - Decompilation of Minecraft: Legacy Console Edition"
gh repo edit GRAnimated/MinecraftLCE --description "$description"
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Commit and push changes
run: |
cd MinecraftLCE-docs
git config --global user.name "Update progress workflow"
git config --global user.email "actions@github.com"
git add progress.csv
git commit -m "Update progress on commit ${{ github.sha }}"
git push origin main