Large fixes + names update #177
This file contains hidden or 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: Deploy ModAPI Dlls & Update Documentation | |
| on: [push, pull_request] | |
| jobs: | |
| compile: | |
| name: Compile ModAPI core DLLS | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed to count all the commits | |
| - name: Add msbuild to PATH | |
| uses: microsoft/setup-msbuild@v1 | |
| - name: Set up MSVC cmd | |
| uses: ilammy/msvc-dev-cmd@v1.12.1 | |
| with: | |
| arch: x86 | |
| - name: Compile DLLs | |
| run: | | |
| $count = git log --oneline | wc -l | |
| echo "Building version $count" | |
| msbuild "Spore ModAPI" -t:BuildDlls -p:BuildVer=$count -p:Config=Release | |
| msbuild "Spore ModAPI" -t:BuildCombinedDll -p:BuildVer=$count -p:Config=Release | |
| - name: Compile Legacy DLLs | |
| run: | | |
| $count = git log --oneline | wc -l | |
| echo "Building version $count" | |
| msbuild "Spore ModAPI Legacy" -t:BuildLegacyDlls -p:BuildVer=$count -p:Config=Release | |
| - name: Upload compiled files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: compiled-modapi-dlls | |
| path: | | |
| dll\Release\SporeModAPI.march2017.dll | |
| dll\Release\SporeModAPI.disk.dll | |
| dll\Release\SporeModAPI.combined.dll | |
| dll\Release\SporeModAPI.lib | |
| - name: Upload compiled legacy files | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: compiled-modapi-legacy-dlls | |
| path: | | |
| legacydll\Release\SporeModAPI-disk.dll | |
| legacydll\Release\SporeModAPI-steam_patched.dll | |
| deploy: | |
| name: Deploy ModAPI DLLs update | |
| needs: compile | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - name: Download compiled files | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: compiled-modapi-dlls | |
| - name: Download compiled legacy files | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: compiled-modapi-legacy-dlls | |
| - name: Create update bundle | |
| run: zip SporeModAPIdlls.zip SporeModAPI.march2017.dll SporeModAPI.disk.dll SporeModAPI.combined.dll SporeModAPI.lib | |
| - name: Create legacy update bundle | |
| run: zip SporeModAPIlegacydlls.zip SporeModAPI-disk.dll SporeModAPI-steam_patched.dll | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Needed to count all the commits | |
| path: Spore-ModAPI | |
| - name: Get version number | |
| id: version_number | |
| run: | | |
| cd Spore-ModAPI | |
| count=$(git log --oneline | wc -l) | |
| echo "version=$count" >> $GITHUB_OUTPUT | |
| - name: Get commit message | |
| id: commit_message | |
| run: | | |
| cd Spore-ModAPI | |
| message=$(git log -1 --pretty=%B) | |
| echo "message=$message" >> $env:GITHUB_OUTPUT | |
| - name: Release to GitHub | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| # prerelease: true | |
| name: ModAPI SDK v2.5.${{ steps.version_number.outputs.version }} | |
| tag_name: v2.5.${{ steps.version_number.outputs.version }} | |
| body: ${{ steps.commit_message.outputs.message }} | |
| files: | | |
| SporeModAPIdlls.zip | |
| SporeModAPIlegacydlls.zip | |
| documentation: | |
| name: Generate documentation | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - name: Install Doxygen | |
| uses: ssciwr/doxygen-install@v1.2.0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4.7.1 | |
| - name: Install Python dependencies | |
| run: pip3 install jinja2 Pygments | |
| - name: Checkout m.css repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: emd4600/m.css | |
| path: m.css | |
| - name: Checkout ModAPI repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: Spore-ModAPI | |
| fetch-depth: 0 # Needed to count all the commits | |
| - name: Run m.css | |
| run: | | |
| cd Spore-ModAPI | |
| python3 ../m.css/documentation/doxygen.py "Documentation/Doxygen-mcss.txt" --debug | |
| - name: Commit documentation pages | |
| run: | | |
| cd Spore-ModAPI | |
| count=$(git log --oneline | wc -l) | |
| cd modapi-generated-docs/html | |
| # Needed to ensure Jekyll is not run, as it omits certain files | |
| touch .nojekyll | |
| git init | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git remote add origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git | |
| git fetch | |
| git symbolic-ref HEAD refs/remotes/origin/gh-pages | |
| git reset | |
| # only commit when uncomitted changes are available | |
| if [[ "$(git diff --name-only refs/remotes/origin/gh-pages | wc -l)" != "0" ]] | |
| then | |
| git add . | |
| git commit -m "Documentation update $count" | |
| fi | |
| - name: Upload changes to GitHub | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: gh-pages | |
| directory: Spore-ModAPI/modapi-generated-docs/html | |