Skip to content

Commit

Permalink
github actions: use offical UPX, update .editorconfig
Browse files Browse the repository at this point in the history
* Update .editorconfig so my Emacs doesn't add tabs into the YAML files
  anymore

* The UPX version in ubuntu doesn't use the NRV library and seems to be
  a bit buggier. Furthermore, UPX is GPL and they allow an exception
  only if the binary is compressed with the official build. The latter
  is not really a problem, nobody will care, but the worse compression
  and potential crashes are. So just use the official build for Linux.
  Windows was already using it, but to keep it consistent with
  UPX_VERSION we now also download it instead of using Chocolatey.
  • Loading branch information
brakhane committed Jan 18, 2025
1 parent 55db8ab commit 7fa7841
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ indent_size = 4

[*.py]
indent_style = space

[*.yml]
indent_style = space
indent_size = 2
17 changes: 14 additions & 3 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
schedule:
- cron: '0 0 * * *'

env:
UPX_VERSION: 4.2.4

jobs:

windows:
Expand Down Expand Up @@ -34,9 +37,11 @@ jobs:
move Editor\languages .\
move Editor\fonts .\
- name: Install UPX
- name: Install official UPX
shell: cmd
run: choco install --no-progress upx
run: |
curl -sOSL https://github.com/upx/upx/releases/download/v%UPX_VERSION%/upx-%UPX_VERSION%-win64.zip
unzip -qj upx-%UPX_VERSION%-win64.zip upx-%UPX_VERSION%-win64/upx.exe
- name: Compress Editor with UPX
shell: cmd
Expand Down Expand Up @@ -90,8 +95,14 @@ jobs:
mv Editor/languages ./
mv Editor/fonts ./
- name: Install official UPX
steps:
run: |
curl -sOSL https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-amd64_linux.tar.xz
tar xf upx-$UPX_VERSION-amd64_linux.tar.xz upx-$UPX_VERSION-amd64_linux/upx
- name: Compress Editor with UPX
run: upx --best Editor_Linux
run: upx-$UPX_VERSION-amd64_linux/upx --best Editor_Linux

- name: Package Editor
uses: actions/upload-artifact@v4
Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,27 @@ concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

env:
UPX_VERSION: 4.2.4

jobs:

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Initial compile
shell: cmd
run: |
"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" WickedEngine.sln /t:OfflineShaderCompiler /m /p:Configuration=Release /p:Platform=x64
- name: Generate shader dump
shell: cmd
run: |
cd "WickedEngine"
"../BUILD/x64/Release/OfflineShaderCompiler/OfflineShaderCompiler.exe" hlsl6 spirv shaderdump strip_reflection
- name: Recompile with shader dump
shell: cmd
run: |
Expand All @@ -37,9 +43,11 @@ jobs:
move Editor\languages .\
move Editor\fonts .\
- name: Install UPX
- name: Install official UPX
shell: cmd
run: choco install --no-progress upx
run: |
curl -sOSL https://github.com/upx/upx/releases/download/v%UPX_VERSION%/upx-%UPX_VERSION%-win64.zip
unzip -qj upx-%UPX_VERSION%-win64.zip upx-%UPX_VERSION%-win64/upx.exe
- name: Compress Editor with UPX
shell: cmd
Expand Down Expand Up @@ -109,8 +117,14 @@ jobs:
mv Editor/languages ./
mv Editor/fonts ./
- name: Install official UPX
steps:
run: |
curl -sOSL https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-amd64_linux.tar.xz
tar xf upx-$UPX_VERSION-amd64_linux.tar.xz upx-$UPX_VERSION-amd64_linux/upx
- name: Compress Editor with UPX
run: upx --best Editor_Linux
run: upx-$UPX_VERSION-amd64_linux/upx --best Editor_Linux

- name: Package Editor
uses: actions/upload-artifact@v4
Expand All @@ -123,6 +137,7 @@ jobs:
startup.lua
Editor_Linux
content:
runs-on: windows-latest
steps:
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches: [ master ]

env:
UPX_VERSION: 4.2.4

jobs:

windows:
Expand Down Expand Up @@ -34,9 +37,11 @@ jobs:
move Editor\languages .\
move Editor\fonts .\
- name: Install UPX
- name: Install official UPX
shell: cmd
run: choco install --no-progress upx
run: |
curl -sOSL https://github.com/upx/upx/releases/download/v%UPX_VERSION%/upx-%UPX_VERSION%-win64.zip
unzip -qj upx-%UPX_VERSION%-win64.zip upx-%UPX_VERSION%-win64/upx.exe
- name: Compress Editor with UPX
shell: cmd
Expand Down Expand Up @@ -106,8 +111,14 @@ jobs:
mv Editor/languages ./
mv Editor/fonts ./
- name: Install official UPX
steps:
run: |
curl -sOSL https://github.com/upx/upx/releases/download/v$UPX_VERSION/upx-$UPX_VERSION-amd64_linux.tar.xz
tar xf upx-$UPX_VERSION-amd64_linux.tar.xz upx-$UPX_VERSION-amd64_linux/upx
- name: Compress Editor with UPX
run: upx --best Editor_Linux
run: upx-$UPX_VERSION-amd64_linux/upx --best Editor_Linux

- name: Package Editor
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 7fa7841

Please sign in to comment.