Skip to content

v0.11.0

v0.11.0 #33

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Extract data and release
on:
release:
types: [published]
workflow_call:
workflow_dispatch:
jobs:
extract:
name: Extract game data
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: latest
- name: Install Cytrus v6
run: npm i cytrus-v6 -g
- name: Read current game version
id: read_dofus_version
run: |
$CytrusGameVersion=$(cytrus-v6 version --game dofus --release dofus3)
$GameVersion=$CytrusGameVersion.Split("_")[1]
echo "dofus_version=$GameVersion" >> $Env:GITHUB_OUTPUT
echo "dofus_path=dofus-$GameVersion" >> $Env:GITHUB_OUTPUT
- name: Restore game files
id: restore_game_files
uses: actions/cache/restore@v4
with:
path: ${{ steps.read_dofus_version.outputs.dofus_path }}
key: ${{ steps.read_dofus_version.outputs.dofus_path }}
- name: Download latest game files
if: ${{ steps.restore_game_files.outputs.cache-hit != 'true' }}
run: cytrus-v6 download --game dofus --release dofus3 -o ${{ steps.read_dofus_version.outputs.dofus_path }}
- name: Download BepInEx
run: curl https://builds.bepinex.dev/projects/bepinex_be/697/BepInEx-Unity.IL2CPP-win-x64-6.0.0-be.697%2B5362580.zip -o BepInEx.zip
- name: Extract BepInEx
run: 7z x BepInEx.zip -o"${{ steps.read_dofus_version.outputs.dofus_path }}" -aoa
- name: Run game once
run: node scripts/bepinex-run-until "${{ steps.read_dofus_version.outputs.dofus_path }}\Dofus.exe" "Chainloader startup complete"
timeout-minutes: 10
- name: Read game build id
id: read_dofus_build_id
run: echo "dofus_build_id=$(node scripts/read-build-guid.js ${{ steps.read_dofus_version.outputs.dofus_path }}/Dofus_Data/boot.config)" >> $Env:GITHUB_OUTPUT
- name: Display build information
run: |
echo "Build id: ${{ steps.read_dofus_build_id.outputs.dofus_build_id }}"
echo "Version: ${{ steps.read_dofus_version.outputs.dofus_version }}"
- name: Create Interop folder
run: md Interop -Force
- name: Copy Interop assemblies
run: copy ${{ steps.read_dofus_version.outputs.dofus_path }}/BepInEx/interop/* Interop/
- name: Restore dependencies
run: dotnet restore
- name: Publish
run: dotnet publish DDC.Extractor/DDC.Extractor.csproj --configuration Release --no-restore
- name: Pack plugin
run: |
./pack.ps1 -configuration Release -output ${{ steps.read_dofus_version.outputs.dofus_path }}/BepInEx/plugins/DDC
- name: Create BepInEx config folder
run: md ${{ steps.read_dofus_version.outputs.dofus_path }}/BepInEx/config -Force
- name: Write DDC.Extractor configuration
run: |
$Configuration = @'
[General]
OutputDirectory = ./extracted-data
'@
echo "$Configuration" > ${{ steps.read_dofus_version.outputs.dofus_path }}/BepInEx/config/DDC.Extractor.cfg
- name: Run DDC.Extractor
run: cd ${{ steps.read_dofus_version.outputs.dofus_path }}; node ../scripts/bepinex-run-until "Dofus.exe" "DDC data extraction complete."
- name: Build DofusBundleReader
run: dotnet build DofusBundleReader/DofusBundleReader.csproj --configuration Release --no-restore
- name: Run DofusBundleReader worldgraph
run: cd ${{ steps.read_dofus_version.outputs.dofus_path }}; &"../DofusBundleReader/bin/Release/net8.0/DofusBundleReader.exe" worldgraph "Dofus_Data/StreamingAssets/aa/StandaloneWindows64" -o ./extracted-data
- name: Run DofusBundleReader maps
run: cd ${{ steps.read_dofus_version.outputs.dofus_path }}; &"../DofusBundleReader/bin/Release/net8.0/DofusBundleReader.exe" maps "Dofus_Data/StreamingAssets/Content/Map" -o ./extracted-data
- name: Create metadata file
run: |
$Metadata = @{
BepInExVersion = "6.0.0-be.697+5362580"
GameBuildId = "${{ steps.read_dofus_build_id.outputs.dofus_build_id }}"
GameVersion = "${{ steps.read_dofus_version.outputs.dofus_version }}"
}
$MetadataJson = $Metadata | ConvertTo-Json
$null = Write-Host $MetadataJson
$null = $MetadataJson | Out-File -FilePath "${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data/metadata.json"
- name: Create release archive
if: ${{ github.event_name == 'release' }}
run: |
cd ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data
7z a data.zip .
- name: Upload data to release
if: ${{ github.event_name == 'release' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data/data.zip
asset_name: data.zip
tag: ${{ github.ref }}
- name: Upload data to artifacts
if: ${{ github.event_name != 'release' }}
uses: actions/upload-artifact@v4
with:
name: data
path: ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data
if-no-files-found: 'error'
permissions:
contents: write
packages: read