feat: Add Automated Reflection Documentation Generation #69
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: | ||
push: | ||
branches: | ||
- master | ||
- development | ||
paths: | ||
- "FicsItNetworks.uplugin" | ||
- "Content/**" | ||
- "Source/**" | ||
- "ThirdParty/**" | ||
pull_request: | ||
branches: | ||
- "master" | ||
- "development" | ||
paths: | ||
- "Content/**" | ||
- "Source/**" | ||
- "ThirdParty/**" | ||
workflow_dispatch: | ||
workflow_call: | ||
secrets: | ||
WWISE_EMAIL: | ||
required: true | ||
WWISE_PASSWORD: | ||
required: true | ||
GH_TOKEN: | ||
required: true | ||
WEBHOOK_URL: | ||
required: true | ||
jobs: | ||
build: | ||
name: Build FicsIt-Networks | ||
runs-on: Windows2019-selfhosted | ||
steps: | ||
- name: Cleanup | ||
run: Remove-Item C:\actions-runner\_work\FicsIt-Networks\FicsIt-Networks\* -Recurse -Force -Confirm:$false -ErrorAction Ignore | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: satisfactorymodding/SatisfactoryModLoader | ||
ref: refs/heads/dev | ||
path: SatisfactoryModLoader | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: SatisfactoryModLoader/Mods/FicsItNetworks | ||
submodules: recursive | ||
# - name: List Stuff | ||
# run: | | ||
# dir SatisfactoryModLoader/Mods/FicsItNetworks | ||
# dir SatisfactoryModLoader/Mods/FicsItNetworks/ThirdParty | ||
# dir SatisfactoryModLoader/Mods/FicsItNetworks/ThirdParty/eris | ||
# dir SatisfactoryModLoader/Mods/FicsItNetworks/ThirdParty/eris/src | ||
- name: Apply FG Patches | ||
working-directory: SatisfactoryModLoader | ||
run: git apply .\Mods\FicsItNetworks\SML_Patch.patch -v | ||
- name: Create UE directory | ||
run: mkdir ue | ||
- name: Download, Extract and Setup UE | ||
working-directory: ue | ||
run: | | ||
gh release download --repo satisfactorymodding/UnrealEngine -p "UnrealEngine-CSS-Editor-Win64.7z.*" | ||
7z x UnrealEngine-CSS-Editor-Win64.7z.001 | ||
rm UnrealEngine-CSS-Editor-Win64.7z* | ||
.\\SetupScripts\\Register.bat | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN }} | ||
- name: Add Wwise | ||
run: | | ||
gh release download --repo mircearoata/wwise-cli -p "wwise-cli.exe" | ||
./wwise-cli.exe download --sdk-version "2022.1.5.8242" --filter Packages=SDK --filter DeploymentPlatforms=Windows_vc140 --filter DeploymentPlatforms=Windows_vc150 --filter DeploymentPlatforms=Windows_vc160 --filter DeploymentPlatforms=Windows_vc170 --filter DeploymentPlatforms=Linux --filter DeploymentPlatforms= | ||
./wwise-cli.exe integrate-ue --integration-version "2022.1.5.2714" --project "${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.uproject" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
WWISE_EMAIL: ${{ secrets.WWISE_EMAIL }} | ||
WWISE_PASSWORD: ${{ secrets.WWISE_PASSWORD }} | ||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v2 | ||
- name: Generate VS project files | ||
run: ${{ github.workspace }}\ue\Engine\Build\BatchFiles\Build.bat -projectfiles -project='${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.uproject' -game -rocket -progres | ||
- name: Build for Development Editor | ||
run: MSBuild.exe '${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.sln' /p:Configuration='Development Editor' /p:Platform='Win64' /t:'Games\FactoryGame' -m | ||
- name: Build for Shipping/Client | ||
run: MSBuild.exe '${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.sln' /p:Configuration='Shipping' /p:Platform='Win64' /t:'Games\FactoryGame' -m | ||
# - name: Build for Win64 Dedicated Server | ||
# run: MSBuild.exe '${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.sln' /p:Configuration='Shipping Server' /p:Platform='Win64' /t:'Games\FactoryGame' -m | ||
# - name: Build for Linux Dedicated Server | ||
# run: MSBuild.exe '${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.sln' /p:Configuration='Shipping Server' /p:Platform='Linux' /t:'Games\FactoryGame' -m | ||
- name: Generate Reflection & Lua Documentation | ||
run: ${{ github.workspace }}\ue\\Engine\Binaries\Win64\UnrealEditor-Cmd.exe ${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.uproject -skipcompile -Log "-ExecCmds=FINGenRefDoc,FINGenLuaDoc,quit_editor" | ||
- name: Package FicsItNetworks Mod | ||
run: ${{ github.workspace }}\ue\Engine\Build\BatchFiles\RunUAT.bat -ScriptsForProject='${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.uproject' PackagePlugin -project='${{ github.workspace }}\SatisfactoryModLoader\FactoryGame.uproject' -clientconfig=Shipping -serverconfig=Shipping -DLCName='FicsItNetworks' -build -utf8output -platform=Win64 -nocompileeditor -installed -abslog="C:\Users\runneradmin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+a+FicsIt-Networks+FicsIt-Networks+ue\Log.txt" | ||
# - name: Show Package Log | ||
# if: always() | ||
# run: more "C:\Users\runneradmin\AppData\Roaming\Unreal Engine\AutomationTool\Logs\D+a+FicsIt-Networks+FicsIt-Networks+ue\Cook-*" | ||
# - name: List Artifacts | ||
# run: | | ||
# dir ${{ github.workspace }}\SatisfactoryModLoader\Saved\ArchivedPlugins\FicsItNetworks\ | ||
- name: Upload FicsItNetworks-Windows.zip | ||
id: upload-artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: FicsItNetworks-Windows | ||
path: ${{github.workspace}}\SatisfactoryModLoader\Saved\ArchivedPlugins\FicsItNetworks\FicsItNetworks-Windows.zip | ||
- name: Upload Documentation | ||
id: upload-artifacts | ||
Check failure on line 126 in .github/workflows/build.yml GitHub Actions / BuildInvalid workflow file
Check failure on line 126 in .github/workflows/build.yml GitHub Actions / BuildInvalid workflow file
|
||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Documentation | ||
path: | | ||
%LocalAppData%\FactoryGame\Saved\FINReflectionDocumentation.json | ||
%LocalAppData%\FactoryGame\Saved\FINLuaDocumentation.lua | ||
- name: Create Discord Webhook Action | ||
uses: devops-actions/[email protected] | ||
if: success() | ||
with: | ||
filename: "discord-webhook.json" | ||
json: > | ||
{ | ||
"username": "GitHub", | ||
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128", | ||
"embeds": [{ | ||
"title": "${{ github.ref_name }}", | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"description": "Build Successful!", | ||
"color": 65280, | ||
"fields": [{ | ||
"value": "[FicsIt-Networks.zip](${{ steps.upload-artifacts.outputs.artifact-url }})", | ||
"name": "", | ||
"inline": true | ||
}] | ||
}] | ||
} | ||
- name: Create Discord Webhook Action | ||
uses: devops-actions/[email protected] | ||
if: cancelled() | ||
with: | ||
filename: "discord-webhook.json" | ||
json: > | ||
{ | ||
"username": "GitHub", | ||
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128", | ||
"embeds": [{ | ||
"title": "${{ github.ref_name }}", | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"description": "Build Cancelled!", | ||
"color": 13158580 | ||
}] | ||
} | ||
- name: Create Discord Webhook Action | ||
uses: devops-actions/[email protected] | ||
if: failure() | ||
with: | ||
filename: "discord-webhook.json" | ||
json: > | ||
{ | ||
"username": "GitHub", | ||
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128", | ||
"embeds": [{ | ||
"title": "${{ github.ref_name }}", | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"description": "Build Failed", | ||
"color": 16711680 | ||
}] | ||
} | ||
- name: Create Discord Webhook Action | ||
uses: devops-actions/[email protected] | ||
if: ${{ !success() && !failure() && !cancelled() }} | ||
with: | ||
filename: "discord-webhook.json" | ||
json: > | ||
{ | ||
"username": "GitHub", | ||
"avatar_url": "https://cdn.discordapp.com/avatars/735904925900472323/df91181b3f1cf0ef1592fbe18e0962d7.webp?size=128", | ||
"embeds": [{ | ||
"title": "${{ github.ref_name }}", | ||
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"description": "Build Done!", | ||
"color": 6579300 | ||
}] | ||
} | ||
- name: Discord Webhook Action | ||
uses: tsickert/[email protected] | ||
if: always() | ||
with: | ||
webhook-url: ${{ secrets.WEBHOOK_URL }} | ||
raw-data: discord-webhook.json | ||
# embed-title: ${{ github.ref_name }} | ||
# embed-url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
# embed-description: Build ${{ success() && 'Successful' || cancelled() && 'Cancelled' || failure() && 'Failed' || 'Done' }}! | ||
# embed-color: ${{ success() && '65280' || cancelled() && '13158580' || failure() && '16711680' || '6579300' }} | ||
documentation: | ||
needs: build | ||
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request' | ||
name: Update Documentation | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Download Reflection Documentation | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Documentation | ||
path: ./docs | ||
- name: Rewrite ASCIIDOC with new Documentation | ||
run: python ./docs/PatchDocWithReflectionDoc.py FINReflectionDocumentation.json | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Commit | ||
run: | | ||
git add index.zip | ||
git commit -m "Update Reflection Documentation" | ||
- name: Push | ||
run: | | ||
git push |