Update README.md so the download link actually points to the right repo #3
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 for Windows | |
on: | |
push: | |
branches: [ "master" ] | |
jobs: | |
build-ws: | |
name: Build WS2 | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
working-directory: ./smblevelworkshop2 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
install: >- | |
base-devel | |
git | |
mingw-w64-x86_64-cmake | |
make | |
mingw-w64-x86_64-gcc | |
mingw-w64-x86_64-qt5 | |
mingw-w64-x86_64-glew | |
mingw-w64-x86_64-glm | |
mingw-w64-x86_64-assimp | |
mingw-w64-x86_64-bullet | |
mingw-w64-x86_64-7zip | |
- name: Set up WS2 environment | |
run: mkdir build | |
- name: Run CMake | |
run: cmake -G "Ninja" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_INSTALL_PREFIX=./build/install -S . -B ./build | |
- name: Make and install the project | |
run: ninja -C ./build -j $(nproc) ws2common/install ws2lz/install ws2lzfrontend/install | |
- name: Install prerequisite libraries | |
run: ninja -C ./build installprerequisites | |
- name: Compress artifacts | |
run: 7z a ./build/SMBLevelWorkshop2-Windows.zip ./build/install/bin/* -x!*.dll.a | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3.1.2 | |
with: | |
# Artifact name | |
name: ws-out | |
# A file, directory or wildcard pattern that describes what to upload | |
path: ./smblevelworkshop2/build/SMBLevelWorkshop2-Windows.zip | |
build-gx: | |
name: Build GxModelViewer | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: ./GxUtils/GxUtils | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- uses: microsoft/setup-msbuild@v1.1 | |
- name: Build the project | |
run: msbuild /M /P:Configuration=Release,DebugSymbols=false,DebugType=None,OutputPath=./out | |
- name: Collect artifacts | |
run: | | |
mkdir .\artifacts | |
mkdir .\artifacts\Presets | |
copy -Force -Path .\GxModelViewer\out\* -Destination .\artifacts | |
copy -Force -Path ..\CHANGES.txt -Destination .\artifacts | |
copy -Force -Path ..\COPYING.txt -Destination .\artifacts | |
copy -Force -Path ..\CREDITS.txt -Destination .\artifacts | |
copy -Force -Path ..\MiscUtilLicense.txt -Destination .\artifacts | |
copy -Force -Path ..\OpenTkLicense.txt -Destination .\artifacts | |
copy -Force -Path ..\README.md -Destination .\artifacts | |
7z.exe a ..\GxUtils-Windows.zip .\artifacts\* "-x!*.config" | |
- uses: actions/upload-artifact@v3.1.2 | |
with: | |
# Artifact name | |
name: gx-out | |
# A file, directory or wildcard pattern that describes what to upload | |
path: ./GxUtils/GxUtils-Windows.zip | |
package-b2smb: | |
name: Package BlendToSMBStage2 | |
runs-on: ubuntu-latest | |
needs: [build-ws, build-gx] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
- name: Set up working directory | |
run: | | |
rmdir smblevelworkshop2 | |
mkdir ws2lzfrontend | |
ls -R | |
7z x ws-out/SMBLevelWorkshop2-Windows.zip -o./ws2lzfrontend | |
7z x gx-out/GxUtils-Windows.zip -o./GxUtils | |
rm -r ws-out | |
rm -r gx-out | |
mkdir out | |
mv $(ls --ignore=out) out/ | |
mv out/ BlendToSMBStage2/ | |
7z a ./BlendToSMBStage2-Windows.zip ./BlendToSMBStage2 | |
- name: Get commit number | |
id: get_commit_number | |
run: echo "commit_number=$(git rev-list master --count)" >> $GITHUB_OUTPUT | |
- name: Get version number | |
id: get_version_number | |
env: | |
major: "2.2" | |
seperator: "-" | |
commit: ${{ steps.get_commit_number.outputs.commit_number }} | |
run: echo "version_number=$major$seperator$commit" >> $GITHUB_OUTPUT | |
- name: Create release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ steps.get_version_number.outputs.version_number }} | |
draft: false | |
prerelease: false | |
generate_release_notes: true | |
files: | | |
./BlendToSMBStage2-Windows.zip | |