Build & Release EHR Without Crowdin Updates #11
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: Build & Release EHR Without Crowdin Updates | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version (e.g. 7.0.2)" | |
| required: true | |
| jobs: | |
| # --------------------------------------------------------- | |
| # 1) Build EHR on Linux | |
| # --------------------------------------------------------- | |
| build-ehr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Build EHR | |
| run: dotnet build EHR.csproj -c Release -o build/ | |
| - name: Upload EHR artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ehr | |
| path: build/EHR.dll | |
| # --------------------------------------------------------- | |
| # 2) Build Control Panel on Windows using MSBuild | |
| # --------------------------------------------------------- | |
| build-control-panel: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Restore .NET packages | |
| run: dotnet restore -p:SelfContained=true CTA/CustomTeamAssigner/CustomTeamAssigner.csproj | |
| - name: Build Control Panel (MSBuild) | |
| run: | | |
| msbuild CTA/CustomTeamAssigner/CustomTeamAssigner.csproj ` | |
| /p:Configuration=Release ` | |
| /p:Platform="x64" ` | |
| /p:PublishSingleFile=true ` | |
| /p:SelfContained=true ` | |
| /p:RuntimeIdentifier=win-x64 ` | |
| /p:IncludeAllContentForSelfExtract=true ` | |
| /p:DebugType=None ` | |
| /p:PublishDir=build\ ` | |
| /t:publish | |
| - name: Rename exe file | |
| run: | | |
| mkdir build/ | |
| mv CTA/CustomTeamAssigner/build/CustomTeamAssigner.exe build/EHR_Control-Panel_BETA.exe | |
| - name: Upload Control Panel artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: control-panel | |
| path: build\EHR_Control-Panel_BETA.exe | |
| # --------------------------------------------------------- | |
| # 3) Package everything on Linux | |
| # --------------------------------------------------------- | |
| package: | |
| runs-on: ubuntu-latest | |
| needs: [build-ehr, build-control-panel] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download EHR artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ehr | |
| path: artifacts/ehr | |
| - name: Prepare release folders | |
| run: | | |
| mkdir -p epic | |
| mkdir -p steam | |
| - name: Download BepInEx 6 pre-release 735 | |
| run: | | |
| curl -L https://builds.bepinex.dev/projects/bepinex_be/735/BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.735%2B5fef357.zip -o bepinex-x64.zip | |
| unzip bepinex-x64.zip -d epic | |
| chmod -R u+rwX,go+rX epic | |
| curl -L https://builds.bepinex.dev/projects/bepinex_be/735/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.735%2B5fef357.zip -o bepinex-x86.zip | |
| unzip bepinex-x86.zip -d steam | |
| chmod -R u+rwX,go+rX steam | |
| - name: Copy EHR dll to plugins | |
| run: | | |
| cp artifacts/ehr/EHR.dll epic/BepInEx/plugins/ | |
| cp artifacts/ehr/EHR.dll steam/BepInEx/plugins/ | |
| - name: Download modded regions DLL | |
| run: | | |
| curl -L https://github.com/miniduikboot/Mini.RegionInstall/releases/download/v1.2.0/Mini.RegionInstall.dll -o epic/BepInEx/plugins/Mini.RegionInstall.dll | |
| cp epic/BepInEx/plugins/Mini.RegionInstall.dll steam/BepInEx/plugins/Mini.RegionInstall.dll | |
| - name: Copy packaging files to BepInEx config | |
| run: | | |
| cp -r packaging/* epic/ | |
| cp -r packaging/* steam/ | |
| - name: Steam App ID | |
| run : echo "945360" > steam_appid.txt | |
| - name: Create Epic/MS Store ZIP | |
| run: | | |
| cd epic | |
| zip -r "../EHR.v${{ github.event.inputs.version }}_Epic-Games_Microsoft-Store.zip" . | |
| - name: Create Steam ZIP | |
| run: | | |
| cd steam | |
| zip -r "../EHR.v${{ github.event.inputs.version }}_Steam.zip" . | |
| - name: Upload release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: final-zips | |
| path: ./EHR*.zip | |
| # --------------------------------------------------------- | |
| # 4) Create GitHub Release | |
| # --------------------------------------------------------- | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [package] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # ----------------------------- | |
| # Download all artifacts | |
| # ----------------------------- | |
| - name: Download packaged ZIPs | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: final-zips | |
| path: release-artifacts/zips | |
| - name: Download EHR.dll | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ehr | |
| path: release-artifacts/ehr | |
| - name: Download Control Panel EXE | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: control-panel | |
| path: release-artifacts/control-panel | |
| # ----------------------------- | |
| # Create GitHub Release | |
| # ----------------------------- | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "v${{ github.event.inputs.version }}" | |
| name: "EHR v${{ github.event.inputs.version }}" | |
| generate_release_notes: true | |
| body_path: CHANGELOG.md | |
| files: | | |
| release-artifacts/zips/* | |
| release-artifacts/ehr/EHR.dll | |
| release-artifacts/control-panel/*.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # ----------------------------- | |
| # Send Mod News | |
| # ----------------------------- | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.x | |
| - name: Install dependencies | |
| run: pip install requests markdown | |
| - name: Run script and send ModNews | |
| env: | |
| MODNEWS_API_URL: ${{ secrets.MODNEWS_API_URL }} | |
| MODNEWS_API_TOKEN: ${{ secrets.MODNEWS_API_TOKEN }} | |
| run: python release_to_modnews.py |