-
Notifications
You must be signed in to change notification settings - Fork 5
144 lines (114 loc) · 5.53 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
143
144
# 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