Skip to content

Commit 5e65477

Browse files
committed
Merge branch 'main' into smw-main
2 parents eb30a71 + d2e9bfb commit 5e65477

File tree

1,217 files changed

+147089
-48532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,217 files changed

+147089
-48532
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Analyze modified files
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**.py"
7+
push:
8+
paths:
9+
- "**.py"
10+
11+
env:
12+
BASE: ${{ github.event.pull_request.base.sha }}
13+
HEAD: ${{ github.event.pull_request.head.sha }}
14+
BEFORE: ${{ github.event.before }}
15+
AFTER: ${{ github.event.after }}
16+
17+
jobs:
18+
flake8-or-mypy:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
task: [flake8, mypy]
23+
24+
name: ${{ matrix.task }}
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v3
29+
30+
- name: "Determine modified files (pull_request)"
31+
if: github.event_name == 'pull_request'
32+
run: |
33+
git fetch origin $BASE $HEAD
34+
DIFF=$(git diff --diff-filter=d --name-only $BASE...$HEAD -- "*.py")
35+
echo "modified files:"
36+
echo "$DIFF"
37+
echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV
38+
39+
- name: "Determine modified files (push)"
40+
if: github.event_name == 'push' && github.event.before != '0000000000000000000000000000000000000000'
41+
run: |
42+
git fetch origin $BEFORE $AFTER
43+
DIFF=$(git diff --diff-filter=d --name-only $BEFORE..$AFTER -- "*.py")
44+
echo "modified files:"
45+
echo "$DIFF"
46+
echo "diff=${DIFF//$'\n'/$' '}" >> $GITHUB_ENV
47+
48+
- name: "Treat all files as modified (new branch)"
49+
if: github.event_name == 'push' && github.event.before == '0000000000000000000000000000000000000000'
50+
run: |
51+
echo "diff=." >> $GITHUB_ENV
52+
53+
- uses: actions/setup-python@v4
54+
if: env.diff != ''
55+
with:
56+
python-version: 3.8
57+
58+
- name: "Install dependencies"
59+
if: env.diff != ''
60+
run: |
61+
python -m pip install --upgrade pip ${{ matrix.task }}
62+
python ModuleUpdate.py --append "WebHostLib/requirements.txt" --force --yes
63+
64+
- name: "flake8: Stop the build if there are Python syntax errors or undefined names"
65+
continue-on-error: false
66+
if: env.diff != '' && matrix.task == 'flake8'
67+
run: |
68+
flake8 --count --select=E9,F63,F7,F82 --show-source --statistics ${{ env.diff }}
69+
70+
- name: "flake8: Lint modified files"
71+
continue-on-error: true
72+
if: env.diff != '' && matrix.task == 'flake8'
73+
run: |
74+
flake8 --count --max-complexity=10 --max-doc-length=120 --max-line-length=120 --statistics ${{ env.diff }}
75+
76+
- name: "mypy: Type check modified files"
77+
continue-on-error: true
78+
if: env.diff != '' && matrix.task == 'mypy'
79+
run: |
80+
mypy --follow-imports=silent --install-types --non-interactive --strict ${{ env.diff }}

.github/workflows/build.yml

+33-25
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,20 @@
22

33
name: Build
44

5-
on: workflow_dispatch
5+
on:
6+
push:
7+
paths:
8+
- '.github/workflows/build.yml'
9+
- 'setup.py'
10+
- 'requirements.txt'
11+
pull_request:
12+
paths:
13+
- '.github/workflows/build.yml'
14+
- 'setup.py'
15+
- 'requirements.txt'
16+
workflow_dispatch:
617

718
env:
8-
SNI_VERSION: v0.0.84
919
ENEMIZER_VERSION: 7.1
1020
APPIMAGETOOL_VERSION: 13
1121

@@ -15,73 +25,67 @@ jobs:
1525
build-win-py38: # RCs will still be built and signed by hand
1626
runs-on: windows-latest
1727
steps:
18-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
1929
- name: Install python
20-
uses: actions/setup-python@v3
30+
uses: actions/setup-python@v4
2131
with:
2232
python-version: '3.8'
2333
- name: Download run-time dependencies
2434
run: |
25-
Invoke-WebRequest -Uri https://github.com/alttpo/sni/releases/download/${Env:SNI_VERSION}/sni-${Env:SNI_VERSION}-windows-amd64.zip -OutFile sni.zip
26-
Expand-Archive -Path sni.zip -DestinationPath SNI -Force
2735
Invoke-WebRequest -Uri https://github.com/Ijwu/Enemizer/releases/download/${Env:ENEMIZER_VERSION}/win-x64.zip -OutFile enemizer.zip
2836
Expand-Archive -Path enemizer.zip -DestinationPath EnemizerCLI -Force
2937
- name: Build
3038
run: |
31-
python -m pip install --upgrade pip setuptools
32-
pip install -r requirements.txt
39+
python -m pip install --upgrade pip
3340
python setup.py build_exe --yes
34-
$NAME="$(ls build)".Split('.',2)[1]
41+
$NAME="$(ls build | Select-String -Pattern 'exe')".Split('.',2)[1]
3542
$ZIP_NAME="Archipelago_$NAME.7z"
43+
echo "$NAME -> $ZIP_NAME"
3644
echo "ZIP_NAME=$ZIP_NAME" >> $Env:GITHUB_ENV
3745
New-Item -Path dist -ItemType Directory -Force
3846
cd build
39-
Rename-Item exe.$NAME Archipelago
47+
Rename-Item "exe.$NAME" Archipelago
4048
7z a -mx=9 -mhe=on -ms "../dist/$ZIP_NAME" Archipelago
4149
- name: Store 7z
42-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v3
4351
with:
4452
name: ${{ env.ZIP_NAME }}
4553
path: dist/${{ env.ZIP_NAME }}
4654
retention-days: 7 # keep for 7 days, should be enough
4755

48-
build-ubuntu1804:
49-
runs-on: ubuntu-18.04
56+
build-ubuntu2004:
57+
runs-on: ubuntu-20.04
5058
steps:
5159
# - copy code below to release.yml -
52-
- uses: actions/checkout@v2
60+
- uses: actions/checkout@v3
5361
- name: Install base dependencies
5462
run: |
5563
sudo apt update
5664
sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0
5765
sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below
5866
- name: Get a recent python
59-
uses: actions/setup-python@v3
67+
uses: actions/setup-python@v4
6068
with:
61-
python-version: '3.9'
69+
python-version: '3.11'
6270
- name: Install build-time dependencies
6371
run: |
64-
echo "PYTHON=python3.9" >> $GITHUB_ENV
72+
echo "PYTHON=python3.11" >> $GITHUB_ENV
6573
wget -nv https://github.com/AppImage/AppImageKit/releases/download/$APPIMAGETOOL_VERSION/appimagetool-x86_64.AppImage
6674
chmod a+rx appimagetool-x86_64.AppImage
6775
./appimagetool-x86_64.AppImage --appimage-extract
6876
echo -e '#/bin/sh\n./squashfs-root/AppRun "$@"' > appimagetool
6977
chmod a+rx appimagetool
7078
- name: Download run-time dependencies
7179
run: |
72-
wget -nv https://github.com/alttpo/sni/releases/download/$SNI_VERSION/sni-$SNI_VERSION-manylinux2014-amd64.tar.xz
73-
tar xf sni-*.tar.xz
74-
rm sni-*.tar.xz
75-
mv sni-* SNI
7680
wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z
7781
7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z
7882
- name: Build
7983
run: |
8084
# pygobject is an optional dependency for kivy that's not in requirements
81-
"${{ env.PYTHON }}" -m pip install --upgrade pip virtualenv PyGObject setuptools
85+
# charset-normalizer was somehow incomplete in the github runner
8286
"${{ env.PYTHON }}" -m venv venv
8387
source venv/bin/activate
84-
pip install -r requirements.txt
88+
"${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject charset-normalizer
8589
python setup.py build_exe --yes bdist_appimage --yes
8690
echo -e "setup.py build output:\n `ls build`"
8791
echo -e "setup.py dist output:\n `ls dist`"
@@ -91,14 +95,18 @@ jobs:
9195
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
9296
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
9397
# - copy code above to release.yml -
98+
- name: Build Again
99+
run: |
100+
source venv/bin/activate
101+
python setup.py build_exe --yes
94102
- name: Store AppImage
95-
uses: actions/upload-artifact@v2
103+
uses: actions/upload-artifact@v3
96104
with:
97105
name: ${{ env.APPIMAGE_NAME }}
98106
path: dist/${{ env.APPIMAGE_NAME }}
99107
retention-days: 7
100108
- name: Store .tar.gz
101-
uses: actions/upload-artifact@v2
109+
uses: actions/upload-artifact@v3
102110
with:
103111
name: ${{ env.TAR_NAME }}
104112
path: dist/${{ env.TAR_NAME }}

.github/workflows/codeql-analysis.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,17 @@ name: "CodeQL"
1414
on:
1515
push:
1616
branches: [ main ]
17+
paths:
18+
- '**.py'
19+
- '**.js'
20+
- '.github/workflows/codeql-analysis.yml'
1721
pull_request:
1822
# The branches below must be a subset of the branches above
1923
branches: [ main ]
24+
paths:
25+
- '**.py'
26+
- '**.js'
27+
- '.github/workflows/codeql-analysis.yml'
2028
schedule:
2129
- cron: '44 8 * * 1'
2230

@@ -35,11 +43,11 @@ jobs:
3543

3644
steps:
3745
- name: Checkout repository
38-
uses: actions/checkout@v2
46+
uses: actions/checkout@v3
3947

4048
# Initializes the CodeQL tools for scanning.
4149
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v1
50+
uses: github/codeql-action/init@v2
4351
with:
4452
languages: ${{ matrix.language }}
4553
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +58,7 @@ jobs:
5058
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5159
# If this step fails, then you should remove it and run the build manually (see below)
5260
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v1
61+
uses: github/codeql-action/autobuild@v2
5462

5563
# ℹ️ Command-line programs to run using the OS shell.
5664
# 📚 https://git.io/JvXDl
@@ -64,4 +72,4 @@ jobs:
6472
# make release
6573

6674
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v1
75+
uses: github/codeql-action/analyze@v2

.github/workflows/lint.yml

-29
This file was deleted.

.github/workflows/release.yml

+9-14
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- '*.*.*'
99

1010
env:
11-
SNI_VERSION: v0.0.84
1211
ENEMIZER_VERSION: 7.1
1312
APPIMAGETOOL_VERSION: 13
1413

@@ -30,46 +29,42 @@ jobs:
3029
# build-release-windows: # this is done by hand because of signing
3130
# build-release-macos: # LF volunteer
3231

33-
build-release-ubuntu1804:
34-
runs-on: ubuntu-18.04
32+
build-release-ubuntu2004:
33+
runs-on: ubuntu-20.04
3534
steps:
3635
- name: Set env
3736
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
3837
# - code below copied from build.yml -
39-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v3
4039
- name: Install base dependencies
4140
run: |
4241
sudo apt update
4342
sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0
4443
sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below
4544
- name: Get a recent python
46-
uses: actions/setup-python@v3
45+
uses: actions/setup-python@v4
4746
with:
48-
python-version: '3.9'
47+
python-version: '3.11'
4948
- name: Install build-time dependencies
5049
run: |
51-
echo "PYTHON=python3.9" >> $GITHUB_ENV
50+
echo "PYTHON=python3.11" >> $GITHUB_ENV
5251
wget -nv https://github.com/AppImage/AppImageKit/releases/download/$APPIMAGETOOL_VERSION/appimagetool-x86_64.AppImage
5352
chmod a+rx appimagetool-x86_64.AppImage
5453
./appimagetool-x86_64.AppImage --appimage-extract
5554
echo -e '#/bin/sh\n./squashfs-root/AppRun "$@"' > appimagetool
5655
chmod a+rx appimagetool
5756
- name: Download run-time dependencies
5857
run: |
59-
wget -nv https://github.com/alttpo/sni/releases/download/$SNI_VERSION/sni-$SNI_VERSION-manylinux2014-amd64.tar.xz
60-
tar xf sni-*.tar.xz
61-
rm sni-*.tar.xz
62-
mv sni-* SNI
6358
wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z
6459
7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z
6560
- name: Build
6661
run: |
6762
# pygobject is an optional dependency for kivy that's not in requirements
68-
"${{ env.PYTHON }}" -m pip install --upgrade pip virtualenv PyGObject setuptools
63+
# charset-normalizer was somehow incomplete in the github runner
6964
"${{ env.PYTHON }}" -m venv venv
7065
source venv/bin/activate
71-
pip install -r requirements.txt
72-
python setup.py build --yes bdist_appimage --yes
66+
"${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject charset-normalizer
67+
python setup.py build_exe --yes bdist_appimage --yes
7368
echo -e "setup.py build output:\n `ls build`"
7469
echo -e "setup.py dist output:\n `ls dist`"
7570
cd dist && export APPIMAGE_NAME="`ls *.AppImage`" && cd ..

0 commit comments

Comments
 (0)