Skip to content

Commit e9933f8

Browse files
committed
feat(ci): add trunk info to release
1 parent dfcc6d2 commit e9933f8

5 files changed

Lines changed: 35 additions & 9 deletions

File tree

packages/cli/src/actions/ci/github.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ export async function createGitHubRelease(
8686
tag_name: `publish/${name}`,
8787
name,
8888
body: [
89-
'| Server | Version | exeHash | 0aHash |',
90-
'| ------ | ------- | ------- | ------ |',
89+
'| Server | Version | Trunk | exeHash | 0aHash |',
90+
'| ------ | ------- | ----- | ------- | ------ |',
9191
...archives.map(
92-
({ server, version, hash }) =>
93-
`| ${kebabCase(server)} | ${version} | ${hash?.exe?.slice(0, 8) || '-'} | ${hash?.excel?.slice(0, 8) || '-'} |`,
92+
({ server, version, trunk, hash }) =>
93+
`| ${kebabCase(server)} | ${version} | ${trunk || '-'} | ${hash?.exe?.slice(0, 8) || '-'} | ${hash?.excel?.slice(0, 8) || '-'} |`,
9494
),
9595
].join('\n'),
9696
draft: false,

packages/cli/src/actions/ci/interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import type { ServerVersion } from '../exd-base'
22

33
export interface Archive extends ServerVersion {
44
path: string
5+
trunk?: string
56
hash?: Record<string, string | undefined>
67
}

packages/cli/src/actions/ci/steps/release.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { createExdFilter } from '@ffcafe/ixion-exd'
1010
import { compressDirectoryToFile } from '@ffcafe/ixion-utils'
1111
import { exdSqPackFile, files } from '../../../config'
1212
import { kebabCase } from '../../../utils/case'
13+
import { readGameTrunk } from '../../../utils/game'
1314
import { calculateHashForArchive } from '../../../utils/hash'
14-
import { parseInputDefinitions } from '../../../utils/input'
1515
import { getTempDir, getWorkingDir } from '../../../utils/root'
1616
import { getStorageManager } from '../../../utils/storage'
1717
import type { ServerVersion } from '../../exd-base'
@@ -59,7 +59,10 @@ async function createServerArchive({
5959
}
6060

6161
await compressDirectoryToFile(tempDir, outputPath)
62-
return calculateHashForArchive(tempDir)
62+
return {
63+
hash: calculateHashForArchive(tempDir),
64+
trunk: readGameTrunk(tempDir),
65+
}
6366
} finally {
6467
// Clean up temporary directory
6568
console.log(`🧹 Cleaning up temporary directory: ${tempDir}\n`)
@@ -173,7 +176,7 @@ export async function createRelease(
173176
const { server, version } = item
174177
console.log(`📂 Creating archive for ${server}: ${version}`)
175178
const path = join(archiveDir, `${kebabCase(server)}-${version}.zip`)
176-
const hash = await createServerArchive({
179+
const result = await createServerArchive({
177180
server,
178181
version,
179182
outputPath: path,
@@ -185,7 +188,8 @@ export async function createRelease(
185188
version,
186189
sqpackPrefix: join(sqpackPath, server, basename(exdSqPackFile)),
187190
path,
188-
hash,
191+
hash: result.hash,
192+
trunk: result.trunk,
189193
})
190194
}
191195

packages/cli/src/actions/create-version.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { dirname, join } from 'node:path'
33
import type { StorageManager } from '@ffcafe/ixion-storage'
44
import { ZipatchReader } from '@ffcafe/ixion-zipatch'
55
import { baseGameVersion, exdSqPackFile, files } from '../config'
6-
import { readGameVersion } from '../utils/game'
6+
import { readGameTrunk, readGameVersion } from '../utils/game'
77
import { getTempDir } from '../utils/root'
88
import { getServerLanguages } from '../utils/server'
99
import { getStorageManager } from '../utils/storage'
@@ -125,6 +125,9 @@ export async function createVersionFromGame(
125125
console.log(`🎮 Recording game version: ${version}`)
126126
console.log(`📁 Game path: ${gamePath}`)
127127

128+
const trunk = readGameTrunk(gamePath)
129+
console.log(`🚀 Game trunk: ${trunk}\n`)
130+
128131
// Get storage manager
129132
let storageManager = getStorageManager()
130133

packages/cli/src/utils/game.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,21 @@ export const readGameVersion = (path: string) => {
88
return null
99
}
1010
}
11+
12+
const trunkRegexp =
13+
/ver_([^\\]+)\\trunk\\prog\\client\\Build\\FFXIVGame\\x64-Release\\ffxiv_dx11.pdb/
14+
15+
export const readGameTrunk = (path: string) => {
16+
const exe = join(path, 'ffxiv_dx11.exe')
17+
try {
18+
const source = readFileSync(exe, 'utf-8')
19+
const match = trunkRegexp.exec(source)
20+
if (match) {
21+
return match[1]
22+
}
23+
24+
return 'unknown'
25+
} catch {
26+
return 'unknown'
27+
}
28+
}

0 commit comments

Comments
 (0)