Update docs.yml #10
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 and Deploy Documentation | |
| on: | |
| push: | |
| branches: [ master, main, stable ] | |
| pull_request: | |
| branches: [ master, main, stable ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout S1API | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Checkout Game Assemblies | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ${{ secrets.GAME_ASSEMBLIES_REPO }} | |
| token: ${{ secrets.GAME_ASSEMBLIES_TOKEN }} | |
| path: game-assemblies | |
| fetch-depth: 1 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Create Assembly Directory Structure | |
| run: | | |
| mkdir -p S1API/ScheduleOneAssemblies/Managed | |
| mkdir -p S1API/ScheduleOneAssemblies/MelonLoader | |
| - name: Debug Game Assemblies Structure | |
| run: | | |
| echo "=== Game Assemblies Repository Structure ===" | |
| find game-assemblies -type f -name "*.dll" | head -20 | |
| echo "" | |
| echo "=== Looking for Assembly-CSharp.dll ===" | |
| find game-assemblies -name "Assembly-CSharp.dll" -type f | |
| - name: Copy Game Assemblies | |
| run: | | |
| # Copy Mono assemblies | |
| if [ -d "game-assemblies/Managed" ]; then | |
| cp -r game-assemblies/Managed/* S1API/ScheduleOneAssemblies/Managed/ || echo "Failed to copy Mono assemblies" | |
| echo "Copied Mono assemblies from game-assemblies/Managed/" | |
| else | |
| echo "No game-assemblies/Managed directory found" | |
| fi | |
| # Copy mod loader assemblies | |
| if [ -d "game-assemblies/MelonLoader" ]; then | |
| cp -r game-assemblies/MelonLoader/* S1API/ScheduleOneAssemblies/MelonLoader/ || echo "Failed to copy MelonLoader assemblies" | |
| echo "Copied MelonLoader assemblies" | |
| else | |
| echo "No game-assemblies/MelonLoader directory found" | |
| fi | |
| - name: Verify Assembly Copies | |
| run: | | |
| echo "=== Verifying Assembly Structure ===" | |
| ls -la S1API/ScheduleOneAssemblies/ | |
| echo "" | |
| echo "=== Managed Assemblies ===" | |
| ls -la S1API/ScheduleOneAssemblies/Managed/ | head -10 | |
| echo "" | |
| echo "=== MelonLoader Assemblies ===" | |
| ls -la S1API/ScheduleOneAssemblies/MelonLoader/ | head -10 | |
| echo "" | |
| echo "=== Critical Assembly Check ===" | |
| if [ -f S1API/ScheduleOneAssemblies/Managed/Assembly-CSharp.dll ]; then | |
| echo "✓ Found Assembly-CSharp.dll" | |
| ls -l S1API/ScheduleOneAssemblies/Managed/Assembly-CSharp.dll | |
| else | |
| echo "✗ Missing Assembly-CSharp.dll" | |
| echo "Attempting auto-discovery..." | |
| find game-assemblies -name "Assembly-CSharp.dll" -type f -exec ls -l {} \; | |
| fi | |
| echo "" | |
| echo "=== MelonLoader Assembly Check ===" | |
| if [ -f S1API/ScheduleOneAssemblies/MelonLoader/0Harmony.dll ]; then | |
| echo "✓ Found 0Harmony.dll" | |
| ls -l S1API/ScheduleOneAssemblies/MelonLoader/0Harmony.dll | |
| else | |
| echo "✗ Missing 0Harmony.dll" | |
| echo "Looking for MelonLoader assemblies..." | |
| find game-assemblies -name "0Harmony.dll" -type f -exec ls -l {} \; | |
| fi | |
| - name: Create CI Build Properties | |
| run: | | |
| cat > S1API/ci.build.props << 'EOF' | |
| <Project> | |
| <PropertyGroup> | |
| <AutomateLocalDeployment>false</AutomateLocalDeployment> | |
| <!-- CI Assembly Paths (relative to S1API/S1API.csproj) --> | |
| <MelonLoaderAssembliesPath>../ScheduleOneAssemblies/MelonLoader</MelonLoaderAssembliesPath> | |
| <!-- Mono Configuration --> | |
| <LocalMonoDeploymentPath>null</LocalMonoDeploymentPath> | |
| <MonoAssembliesPath>../ScheduleOneAssemblies/Managed</MonoAssembliesPath> | |
| </PropertyGroup> | |
| </Project> | |
| EOF | |
| - name: Verify Build Properties | |
| run: | | |
| echo "=== CI Build Properties ===" | |
| cat S1API/ci.build.props | |
| echo "" | |
| echo "=== MSBuild Property Resolution Test ===" | |
| cd S1API | |
| echo "Testing MonoAssembliesPath resolution (expect ./ScheduleOneAssemblies from project dir)..." | |
| if [ -f "./ScheduleOneAssemblies/Managed/Assembly-CSharp.dll" ]; then | |
| echo "✓ Assembly-CSharp.dll accessible from build context" | |
| ls -l ./ScheduleOneAssemblies/Managed/Assembly-CSharp.dll | |
| else | |
| echo "✗ Assembly-CSharp.dll NOT accessible from build context" | |
| echo "Current directory: $(pwd)" | |
| echo "Looking for: ./ScheduleOneAssemblies/Managed/Assembly-CSharp.dll" | |
| ls -la ./ScheduleOneAssemblies/Managed/ || echo "Directory doesn't exist" | |
| fi | |
| echo "" | |
| echo "Testing MelonLoaderAssembliesPath resolution..." | |
| if [ -f "./ScheduleOneAssemblies/MelonLoader/0Harmony.dll" ]; then | |
| echo "✓ 0Harmony.dll accessible from build context" | |
| ls -l ./ScheduleOneAssemblies/MelonLoader/0Harmony.dll | |
| else | |
| echo "✗ 0Harmony.dll NOT accessible from build context" | |
| echo "Current directory: $(pwd)" | |
| echo "Looking for: ./ScheduleOneAssemblies/MelonLoader/0Harmony.dll" | |
| ls -la ./ScheduleOneAssemblies/MelonLoader/ || echo "Directory doesn't exist" | |
| fi | |
| - name: Restore dependencies | |
| run: dotnet restore S1API.sln | |
| - name: Build S1API | |
| run: dotnet build S1API/S1API.csproj --no-restore -c MonoMelon -v normal | |
| - name: Install DocFX | |
| run: dotnet tool install -g docfx | |
| - name: Build documentation | |
| run: | | |
| cd S1API/S1API | |
| docfx docfx.json | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./S1API/S1API/_site | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |