Fix dead threads parsing after forum logo update #1597
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
name: "Build" | |
on: | |
workflow_dispatch: | |
push: | |
release: | |
types: | |
- "published" | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { os: "windows-2022", python: "3.12.4", cx-freeze: "7.0.0", cx-logging: "v3.2.0", astcenc: "5.1.0", compressonator: "4.5.52" } | |
- { os: "ubuntu-22.04", python: "3.12.4", cx-freeze: "7.0.0", cx-logging: "" , astcenc: "5.1.0", compressonator: "4.5.52" } | |
- { os: "macos-13", python: "3.12.4", cx-freeze: "7.0.0", cx-logging: "" , astcenc: "5.1.0", compressonator: "" } | |
name: "${{ matrix.config.os }}" | |
runs-on: "${{ matrix.config.os }}" | |
if: "github.event_name != 'push' || contains(github.event.head_commit.message, '+ BUILD')" | |
steps: | |
# === SETUP === | |
- name: "Set git to use lf" | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: "Setup Python" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: "${{ matrix.config.python }}" | |
- name: "Setup cx_Freeze" | |
env: | |
CIBUILDWHEEL: "1" | |
shell: bash | |
run: | | |
if [ "${{ matrix.config.cx-logging }}" != "" ] ; then | |
python -m pip install -U 'git+https://github.com/anthony-tuininga/cx_Logging.git@${{ matrix.config.cx-logging }}' | |
fi | |
python -m pip install -U 'git+https://github.com/marcelotduarte/cx_Freeze.git@${{ matrix.config.cx-freeze }}' | |
# === BUILD === | |
- name: "Clone repo" | |
uses: "actions/checkout@v4" | |
with: | |
path: "." | |
- name: "Install requirements" | |
run: | | |
python -m pip install -U -r ./requirements.txt | |
- name: "Mark as release" | |
if: "github.event_name == 'release'" | |
run: | | |
sed "s/release = False/release = True/g" ./main.py > ./main.py.new | |
rm ./main.py | |
mv ./main.py.new ./main.py | |
- name: "Mark build number" | |
if: "github.event_name != 'release'" | |
run: | | |
sed "s/build_number = 0/build_number = ${{ github.run_number }}/g" ./main.py > ./main.py.new | |
rm ./main.py | |
mv ./main.py.new ./main.py | |
- name: "Install dependencies (Linux)" | |
if: "runner.os == 'Linux'" | |
run: | | |
sudo apt install -y libxcb-cursor-dev | |
- name: "Build (Windows, Linux)" | |
if: "runner.os != 'macOS'" | |
run: | | |
python ./setup.py build | |
mv ./build/exe.*/ ./dist/ | |
- name: "Build (macOS)" | |
if: "runner.os == 'macOS'" | |
run: | | |
python ./setup.py bdist_mac | |
mkdir ./dist/ | |
mv ./build/*.app/ ./dist/ | |
- name: "Resolve symlinks (Linux, macOS)" | |
if: "runner.os != 'Windows'" | |
run: | | |
cd ./dist/ | |
find ./ -type l -exec echo Resolving {} \; -exec sed -i '' {} \; | |
# - name: "Import codesign certificate (macOS)" | |
# if: "runner.os == 'macOS'" | |
# uses: "apple-actions/import-codesign-certs@v1" | |
# with: | |
# p12-file-base64: "${{ secrets.CODESIGN_P12_BASE64 }}" | |
# p12-password: "${{ secrets.CODESIGN_P12_PASSWORD }}" | |
# - name: "Codesign (macOS)" | |
# if: "runner.os == 'macOS'" | |
# run: | | |
# cd ./dist/ | |
# find ./ -type f -empty -delete | |
# codesign -s "${{ secrets.CODESIGN_P12_NAME }}" --deep ./*.app | |
- name: "Bundle astcenc+compressonator (Windows)" | |
if: "runner.os == 'Windows'" | |
shell: bash | |
run: | | |
curl -L -o astcenc-x64.zip https://github.com/ARM-software/astc-encoder/releases/download/${{ matrix.config.astcenc }}/astcenc-${{ matrix.config.astcenc }}-windows-x64.zip | |
curl -L -o astcenc-arm64.zip https://github.com/ARM-software/astc-encoder/releases/download/${{ matrix.config.astcenc }}/astcenc-${{ matrix.config.astcenc }}-windows-arm64.zip | |
7z x astcenc-x64.zip | |
7z x astcenc-arm64.zip | |
mkdir ./dist/lib/astcenc/ | |
mv ./bin/astcenc-avx2.exe ./dist/lib/astcenc | |
mv ./bin/astcenc-sse2.exe ./dist/lib/astcenc | |
mv ./bin/astcenc-neon.exe ./dist/lib/astcenc | |
curl -L -o compressonatorcli.zip https://github.com/GPUOpen-Tools/compressonator/releases/download/V${{ matrix.config.compressonator }}/compressonatorcli-${{ matrix.config.compressonator }}-win64.zip | |
7z x compressonatorcli.zip | |
rm -rf compressonatorcli-*/{documents,images} | |
mv ./compressonatorcli-*/ ./dist/lib/compressonator/ | |
- name: "Bundle astcenc+compressonator (Linux)" | |
if: "runner.os == 'Linux'" | |
run: | | |
curl -L -o astcenc-x64.zip https://github.com/ARM-software/astc-encoder/releases/download/${{ matrix.config.astcenc }}/astcenc-${{ matrix.config.astcenc }}-linux-x64.zip | |
7z x astcenc-x64.zip | |
mkdir ./dist/lib/astcenc/ | |
mv ./bin/astcenc-avx2 ./dist/lib/astcenc/ | |
mv ./bin/astcenc-sse2 ./dist/lib/astcenc/ | |
curl -L -o compressonatorcli.tar.gz https://github.com/GPUOpen-Tools/compressonator/releases/download/V${{ matrix.config.compressonator }}/compressonatorcli-${{ matrix.config.compressonator }}-Linux.tar.gz | |
tar xzf compressonatorcli.tar.gz | |
rm -rf compressonatorcli-*/{documents,images} | |
mv ./compressonatorcli-*/ ./dist/lib/compressonator/ | |
- name: "Bundle astcenc (macOS)" | |
if: "runner.os == 'macOS'" | |
run: | | |
curl -L -o astcenc-universal.zip https://github.com/ARM-software/astc-encoder/releases/download/${{ matrix.config.astcenc }}/astcenc-${{ matrix.config.astcenc }}-macos-universal.zip | |
7z x astcenc-universal.zip | |
mkdir $(echo ./dist/*.app)/Contents/Resources/lib/astcenc/ | |
mv ./bin/astcenc ./dist/*.app/Contents/Resources/lib/astcenc/ | |
# === ARTIFACT === | |
- name: "Zip artifact" | |
run: | | |
cd ./dist/ | |
7z a ../${{ github.event.repository.name }}-${{ runner.os }}.zip . | |
- name: "Upload commit artifact" | |
if: "github.event_name != 'release'" | |
uses: "actions/upload-artifact@v4" | |
with: | |
name: "${{ github.event.repository.name }}-${{ runner.os }}-Artifact" | |
path: "./${{ github.event.repository.name }}-${{ runner.os }}.zip" | |
compression-level: 0 | |
- name: "Upload release artifact" | |
if: "github.event_name == 'release'" | |
uses: "softprops/action-gh-release@v1" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
with: | |
files: "./${{ github.event.repository.name }}-${{ runner.os }}.zip" | |
source: | |
name: "source" | |
runs-on: "ubuntu-latest" | |
if: "github.event_name != 'push' || contains(github.event.head_commit.message, '+ BUILD')" | |
steps: | |
# === SETUP === | |
- name: "Set git to use lf" | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
# === PACKAGE === | |
- name: "Clone repo" | |
uses: "actions/checkout@v4" | |
with: | |
path: "." | |
- name: "Mark as release" | |
if: "github.event_name == 'release'" | |
run: | | |
sed "s/release = False/release = True/g" ./main.py > ./main.py.new | |
rm ./main.py | |
mv ./main.py.new ./main.py | |
- name: "Mark build number" | |
if: "github.event_name != 'release'" | |
run: | | |
sed "s/build_number = 0/build_number = ${{ github.run_number }}/g" ./main.py > ./main.py.new | |
rm ./main.py | |
mv ./main.py.new ./main.py | |
- name: "Package" | |
run: | | |
python ./setup.py || true | |
mkdir ./dist/ | |
cp -r ./browser/ ./dist/ | |
cp -r ./common/ ./dist/ | |
cp -r ./external/ ./dist/ | |
cp -r ./modules/ ./dist/ | |
cp -r ./resources/ ./dist/ | |
cp ./LICENSE ./dist/ | |
cp ./main.py ./dist/ | |
cp ./main-debug.py ./dist/ | |
cp ./requirements.txt ./dist/ | |
# === ARTIFACT === | |
- name: "Zip artifact" | |
run: | | |
cd ./dist/ | |
7z a ../${{ github.event.repository.name }}-Source.zip . | |
- name: "Upload commit artifact" | |
if: "github.event_name != 'release'" | |
uses: "actions/upload-artifact@v4" | |
with: | |
name: "${{ github.event.repository.name }}-Source-Artifact" | |
path: "./${{ github.event.repository.name }}-Source.zip" | |
compression-level: 0 | |
- name: "Upload release artifact" | |
if: "github.event_name == 'release'" | |
uses: "softprops/action-gh-release@v1" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
with: | |
files: "./${{ github.event.repository.name }}-Source.zip" | |
release: | |
name: "release" | |
runs-on: "ubuntu-latest" | |
if: "github.event_name == 'release'" | |
needs: | |
- build | |
- source | |
steps: | |
- name: "Set git to use lf" | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
- name: "Clone repo" | |
uses: "actions/checkout@v4" | |
with: | |
path: "." | |
- name: "Update release" | |
env: | |
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
run: | | |
python ./.github/workflow_data/release.py | |
- name: "Delete skipped workflow runs" | |
if: "github.event_name == 'release'" | |
uses: "Willy-JL/delete-skipped-workflow-runs@main" | |
with: | |
retain_days: 0 | |
keep_minimum_runs: 0 |