This repository has been archived by the owner on Jan 4, 2025. It is now read-only.
forked from Dofus-Batteries-Included/DDC
-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (112 loc) · 5.96 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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