Skip to content

Commit 55ad717

Browse files
unity-xcode-builder@v1.1.1 (#7)
- fix branch name in test details
1 parent 7acc54f commit 55ad717

5 files changed

Lines changed: 26 additions & 13 deletions

File tree

dist/index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58696,6 +58696,8 @@ async function GetProjectDetails() {
5869658696
let infoPlistContent = plist.parse(fs.readFileSync(infoPlistPath, 'utf8'));
5869758697
const versionString = infoPlistContent['CFBundleShortVersionString'];
5869858698
core.info(`Version string: ${versionString}`);
58699+
const buildString = infoPlistContent['CFBundleVersion'];
58700+
core.info(`Build string: ${buildString}`);
5869958701
return new XcodeProject_1.XcodeProject(projectPath, projectName, platform, bundleId, projectDirectory, versionString, scheme);
5870058702
}
5870158703
async function parseBuildSettings(projectPath, scheme) {
@@ -59299,19 +59301,23 @@ async function getWhatsNew() {
5929959301
const branchNameDetails = await execGit(['log', head, '-1', '--format=%d']);
5930059302
const branchNameMatch = branchNameDetails.match(/\((?<branch>.+)\)/);
5930159303
let branchName = '';
59302-
if (branchNameMatch) {
59304+
if (branchNameMatch && branchNameMatch.groups) {
59305+
branchName = branchNameMatch.groups.branch;
5930359306
if (branchName.includes(' -> ')) {
5930459307
branchName = branchName.split(' -> ')[1];
5930559308
}
5930659309
if (branchName.includes(',')) {
5930759310
branchName = branchName.split(',')[1];
5930859311
}
59309-
if (branchName.includes('origin/')) {
59310-
branchName = branchName.split('origin/')[1];
59312+
if (branchName.includes('/')) {
59313+
branchName = branchName.split('/')[1];
5931159314
}
5931259315
}
59313-
const commitMessage = await execGit(['log', head, '-1', '--format=%s']);
59316+
const commitMessage = await execGit(['log', head, '-1', '--format=%B']);
5931459317
whatsNew = `[${commitSha.trim()}]${branchName.trim()}\n${commitMessage.trim()}`;
59318+
if (whatsNew.length > 4000) {
59319+
whatsNew = `${whatsNew.substring(0, 3997)}...`;
59320+
}
5931559321
}
5931659322
if (whatsNew.length === 0) {
5931759323
throw new Error('Test details empty!');

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-xcode-builder",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "A GitHub Action to build, archive, and upload Unity exported xcode projects.",
55
"author": "buildalon",
66
"license": "MIT",

src/xcode.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ async function GetProjectDetails(): Promise<XcodeProject> {
5959
let infoPlistContent = plist.parse(fs.readFileSync(infoPlistPath, 'utf8'));
6060
const versionString = infoPlistContent['CFBundleShortVersionString'];
6161
core.info(`Version string: ${versionString}`);
62+
const buildString = infoPlistContent['CFBundleVersion'];
63+
core.info(`Build string: ${buildString}`);
6264
return new XcodeProject(
6365
projectPath,
6466
projectName,
@@ -93,7 +95,8 @@ async function parseBuildSettings(projectPath: string, scheme: string): Promise<
9395
if (!platformName) {
9496
throw new Error('Unable to determine the platform name from the build settings');
9597
}
96-
const bundleId = core.getInput('bundle-id') || matchRegexPattern(buildSettingsOutput, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId'); if (!bundleId || bundleId === 'NO') {
98+
const bundleId = core.getInput('bundle-id') || matchRegexPattern(buildSettingsOutput, /\s+PRODUCT_BUNDLE_IDENTIFIER = (?<bundleId>[\w.-]+)/, 'bundleId');
99+
if (!bundleId || bundleId === 'NO') {
97100
throw new Error('Unable to determine the bundle ID from the build settings');
98101
}
99102
const platforms = {
@@ -670,19 +673,23 @@ async function getWhatsNew(): Promise<string> {
670673
const branchNameDetails = await execGit(['log', head, '-1', '--format=%d']);
671674
const branchNameMatch = branchNameDetails.match(/\((?<branch>.+)\)/);
672675
let branchName = '';
673-
if (branchNameMatch) {
676+
if (branchNameMatch && branchNameMatch.groups) {
677+
branchName = branchNameMatch.groups.branch;
674678
if (branchName.includes(' -> ')) {
675679
branchName = branchName.split(' -> ')[1];
676680
}
677681
if (branchName.includes(',')) {
678682
branchName = branchName.split(',')[1];
679683
}
680-
if (branchName.includes('origin/')) {
681-
branchName = branchName.split('origin/')[1];
684+
if (branchName.includes('/')) {
685+
branchName = branchName.split('/')[1];
682686
}
683687
}
684-
const commitMessage = await execGit(['log', head, '-1', '--format=%s']);
688+
const commitMessage = await execGit(['log', head, '-1', '--format=%B']);
685689
whatsNew = `[${commitSha.trim()}]${branchName.trim()}\n${commitMessage.trim()}`;
690+
if (whatsNew.length > 4000) {
691+
whatsNew = `${whatsNew.substring(0, 3997)}...`;
692+
}
686693
}
687694
if (whatsNew.length === 0) {
688695
throw new Error('Test details empty!');

0 commit comments

Comments
 (0)