Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Extract data and release #8

Extract data and release

Extract data and release #8

Workflow file for this run

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 Node
uses: actions/setup-node@v4
with:
node-version: latest
- 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)
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: .\doduda.exe --headless --full -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: 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/*.i18n.json
- name: Notify Doduda persistence
env:
GH_TOKEN: ${{ secrets.PAT }}
run: gh workflow run 65387138 --repo dofusdude/doduda -f version=${{ steps.read_dofus_version.outputs.dofus_version }} -f release=main
permissions:
contents: write
packages: read