This repository has been archived by the owner on Jan 4, 2025. It is now read-only.
Extract data and release #6
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: Extract data and release | |
on: | |
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 Github NPM registry for @dofus-batteries-included namespace | |
run: | | |
echo @dofus-batteries-included:registry=https://npm.pkg.github.com > ~/.npmrc | |
echo //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} >> ~/.npmrc | |
- name: Set up Git Bash | |
uses: msys2/setup-msys2@v2 | |
with: | |
install: >- | |
curl | |
wget | |
- name: Install doduda | |
shell: msys2 {0} | |
run: | | |
curl -s https://api.github.com/repos/dofusdude/doduda/releases/latest | grep "browser_download_url.*Windows_x86_64.zip" | cut -d : -f 2,3 | tr -d \" | wget -qi - | |
- name: Extract doduda | |
run: | | |
7z x doduda_Windows_x86_64.zip -aoa | |
- name: Read current game version | |
id: read_dofus_version | |
run: | | |
$GameVersion=$(.\doduda.exe version --headless --platform windows --release beta) | |
echo "dofus_version=$GameVersion" >> $Env:GITHUB_OUTPUT | |
echo "dofus_path=data" >> $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: .\doduda.exe --headless --full --release beta ${{ steps.read_dofus_version.outputs.dofus_path }} # Use beta for now | |
- 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 assets | |
uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
title: "${{ steps.read_dofus_version.outputs.dofus_version }}" | |
automatic_release_tag: "${{ steps.read_dofus_version.outputs.dofus_version }}" | |
files: ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data/en.i18n.json ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data/fr.i18n.json ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data/es.i18n.json ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data/de.i18n.json ${{ steps.read_dofus_version.outputs.dofus_path }}/extracted-data/pt.i18n.json | |
permissions: | |
contents: write | |
packages: read |