Skip to content

Commit d59e5d2

Browse files
authored
Merge pull request #83 from pol-rivero/update-identifier
Update name of generated binaries
2 parents 91eb993 + 70f2022 commit d59e5d2

13 files changed

Lines changed: 65 additions & 62 deletions

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/app/test/fixtures/** -text
2-
/app/static/win32/github.sh eol=lf
2+
/app/static/win32/github-desktop-plus-cli.sh eol=lf

.github/workflows/ci.yml

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,6 @@ jobs:
189189
AZURE_CLIENT_ID: ${{ secrets.AZURE_CODE_SIGNING_CLIENT_ID }}
190190
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CODE_SIGNING_CLIENT_SECRET }}
191191

192-
# GitHubDesktop-linux-<arch>-<old_version>.<ext> -> GitHubDesktopPlus-<release_tag>-linux-<arch>.<ext>
193-
- name: Rename Linux artifacts
194-
if: ${{ runner.os == 'Linux' }}
195-
run: |
196-
for file in $(find ./dist -type f -name "GitHubDesktop-linux-*"); do
197-
new_name=$(echo "$file" | sed -E "s/GitHubDesktop-linux-(.*)-([0-9]+\\.)+[0-9]+(-beta[0-9]+)?\\.(.*)/GitHubDesktopPlus-v${APP_VERSION}-linux-\\1.\\4/")
198-
new_name=$(echo $new_name | sed -E "s/linux-amd64/linux-x86_64/")
199-
new_name=$(echo $new_name | sed -E "s/linux-aarch64/linux-arm64/")
200-
mv --verbose "$file" "$new_name"
201-
done
202-
203192
- name: Generate AppImage zsync
204193
if: ${{ runner.os == 'Linux' }}
205194
run:
@@ -209,10 +198,10 @@ jobs:
209198
with:
210199
name: ${{matrix.friendlyName}}-${{matrix.arch}}
211200
path: |
212-
dist/GitHub Desktop Plus-${{matrix.arch}}.zip
213-
dist/GitHubDesktop-*.nupkg
214-
dist/GitHubDesktopSetup-${{matrix.arch}}.exe
215-
dist/GitHubDesktopSetup-${{matrix.arch}}.msi
201+
dist/*-macOS-*.zip
202+
dist/*.exe
203+
dist/*.msi
204+
dist/*.nupkg
216205
dist/*.AppImage
217206
dist/*.AppImage.zsync
218207
dist/*.deb
@@ -242,20 +231,6 @@ jobs:
242231
run: ls -R
243232
working-directory: './artifacts'
244233

245-
# GitHubDesktopSetup-<arch>.<ext> -> GitHubDesktopPlus-<release_tag>-windows-<arch>.<ext>
246-
# GitHub Desktop Plus-<arch>.zip -> GitHubDesktopPlus-<release_tag>-macOS-<arch>.zip
247-
- name: Rename Windows/macOS artifacts
248-
run: |
249-
for file in $(find ./artifacts -type f -name "GitHubDesktopSetup-*"); do
250-
new_name=$(echo "$file" | sed -E "s/GitHubDesktopSetup-(.*)\\.(.*)/GitHubDesktopPlus-v${APP_VERSION}-windows-\\1.\\2/")
251-
mv --verbose "$file" "$new_name"
252-
done
253-
254-
find ./artifacts -type f -name "GitHub Desktop Plus-*.zip" -print0 | while IFS= read -r -d '' file; do
255-
new_name=$(echo "$file" | sed -E "s/GitHub Desktop Plus-(.*)\\.zip/GitHubDesktopPlus-v${APP_VERSION}-macOS-\\1.zip/")
256-
mv --verbose "$file" "$new_name"
257-
done
258-
259234
- name: Read release notes
260235
id: release_notes
261236
run: |

app/src/cli/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const run = (...args: Array<string>) => {
1818
if (process.platform === 'darwin') {
1919
execFile('open', ['-n', join(__dirname, '../../..'), '--args', ...args], cb)
2020
} else if (process.platform === 'win32') {
21-
const exeName = `GitHubDesktop${__DEV__ ? '-dev' : ''}.exe`
21+
const exeName = `GitHubDesktopPlus${__DEV__ ? '-dev' : ''}.exe`
2222
spawn(join(__dirname, `../../${exeName}`), args, {
2323
detached: true,
2424
stdio: 'ignore',

app/src/main-process/squirrel-updater.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ function resolveVersionedPath(binPath: string, relativePath: string): string {
9999
function writeBatchScriptCLITrampoline(binPath: string): Promise<void> {
100100
const versionedPath = resolveVersionedPath(
101101
binPath,
102-
'resources/app/static/github.bat'
102+
'resources/app/static/github-desktop-plus-cli.bat'
103103
)
104104

105105
const trampoline = `@echo off\n"%~dp0\\${versionedPath}" %*`
106-
const trampolinePath = Path.join(binPath, 'github.bat')
106+
const trampolinePath = Path.join(binPath, 'github-desktop-plus-cli.bat')
107107

108108
return writeFile(trampolinePath, trampoline)
109109
}
@@ -115,13 +115,13 @@ function writeShellScriptCLITrampoline(binPath: string): Promise<void> {
115115
// to resolve it. See https://github.com/desktop/desktop/issues/4998
116116
const versionedPath = resolveVersionedPath(
117117
binPath,
118-
'resources/app/static/github.sh'
118+
'resources/app/static/github-desktop-plus-cli.sh'
119119
).replace(/\\/g, '/')
120120

121121
const trampoline = `#!/usr/bin/env bash
122122
DIR="$( cd "$( dirname "\$\{BASH_SOURCE[0]\}" )" && pwd )"
123123
sh "$DIR/${versionedPath}" "$@"`
124-
const trampolinePath = Path.join(binPath, 'github')
124+
const trampolinePath = Path.join(binPath, 'github-desktop-plus-cli')
125125

126126
return writeFile(trampolinePath, trampoline, { encoding: 'utf8', mode: 755 })
127127
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
setlocal
3+
4+
set ELECTRON_RUN_AS_NODE=1
5+
call "%~dp0..\..\..\GitHubDesktopPlus.exe" "%~dp0..\cli.js" %*
6+
7+
endlocal

app/static/win32/github.sh renamed to app/static/win32/github-desktop-plus-cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
4-
ELECTRON="$CONTENTS/GitHubDesktop.exe"
4+
ELECTRON="$CONTENTS/GitHubDesktopPlus.exe"
55

66
if grep -q Microsoft /proc/version; then
77
if [ -x /bin/wslpath ]; then

app/static/win32/github.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

script/dist-info.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function getExecutableName() {
3333
}
3434

3535
export function getOSXZipName() {
36-
return `${productName}-${getDistArchitecture()}.zip`
36+
return `GitHubDesktopPlus-v${version}-macOS-${getDistArchitecture()}.zip`
3737
}
3838

3939
export function getOSXZipPath() {
@@ -42,7 +42,7 @@ export function getOSXZipPath() {
4242

4343
export function getWindowsInstallerName() {
4444
const productName = getExecutableName()
45-
return `${productName}Setup-${getDistArchitecture()}.msi`
45+
return `${productName}-v${version}-windows-${getDistArchitecture()}.msi`
4646
}
4747

4848
export function getWindowsInstallerPath() {
@@ -51,7 +51,7 @@ export function getWindowsInstallerPath() {
5151

5252
export function getWindowsStandaloneName() {
5353
const productName = getExecutableName()
54-
return `${productName}Setup-${getDistArchitecture()}.exe`
54+
return `${productName}-v${version}-windows-${getDistArchitecture()}.exe`
5555
}
5656

5757
export function getWindowsStandalonePath() {
@@ -64,7 +64,7 @@ export function getWindowsFullNugetPackageName(
6464
const architectureInfix = includeArchitecture
6565
? `-${getDistArchitecture()}`
6666
: ''
67-
return `${getWindowsIdentifierName()}-${version}${architectureInfix}-full.nupkg`
67+
return `${getWindowsIdentifierName()}-v${version}${architectureInfix}-full.nupkg`
6868
}
6969

7070
export function getWindowsFullNugetPackagePath() {
@@ -82,7 +82,7 @@ export function getWindowsDeltaNugetPackageName(
8282
const architectureInfix = includeArchitecture
8383
? `-${getDistArchitecture()}`
8484
: ''
85-
return `${getWindowsIdentifierName()}-${version}${architectureInfix}-delta.nupkg`
85+
return `${getWindowsIdentifierName()}-v${version}${architectureInfix}-delta.nupkg`
8686
}
8787

8888
export function getWindowsDeltaNugetPackagePath() {
@@ -95,7 +95,7 @@ export function getWindowsDeltaNugetPackagePath() {
9595
}
9696

9797
export function getWindowsIdentifierName() {
98-
return 'GitHubDesktop'
98+
return 'GitHubDesktopPlus'
9999
}
100100

101101
export function getBundleSizes() {
@@ -130,6 +130,16 @@ export function getDistArchitecture(): 'arm64' | 'x64' {
130130
return 'x64'
131131
}
132132

133+
export function getArchitectureForFileName(): 'arm64' | 'x86_64' {
134+
const arch = getDistArchitecture()
135+
switch (arch) {
136+
case 'arm64':
137+
return 'arm64'
138+
case 'x64':
139+
return 'x86_64'
140+
}
141+
}
142+
133143
export function getUpdatesURL() {
134144
// Disable auto-updates so that the app doesn't revert to the desktop/desktop upstream whenever there is an update
135145
return ''

script/electron-builder-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
artifactName: 'GitHubDesktop-${os}-${arch}-${version}.${ext}'
1+
artifactName: 'GitHubDesktopPlus-${os}-${arch}-${version}.${ext}'
22
linux:
33
category: 'GNOME;GTK;Development'
44
packageCategory: 'GNOME;GTK;Development'

script/package-debian.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ const globPromise = promisify(glob)
77
import { rename } from 'fs-extra'
88

99
import { getVersion } from '../app/package-info'
10-
import { getDistPath, getDistRoot } from './dist-info'
10+
import {
11+
getDistPath,
12+
getDistRoot,
13+
getArchitectureForFileName,
14+
} from './dist-info'
1115

1216
function getArchitecture() {
1317
const arch = process.env.npm_config_arch || process.arch
@@ -109,7 +113,7 @@ export async function packageDebian(): Promise<string> {
109113

110114
const oldPath = files[0]
111115

112-
const newFileName = `GitHubDesktop-linux-${getArchitecture()}-${getVersion()}.deb`
116+
const newFileName = `GitHubDesktopPlus-v${getVersion()}-linux-${getArchitectureForFileName()}.deb`
113117
const newPath = join(distRoot, newFileName)
114118
await rename(oldPath, newPath)
115119

0 commit comments

Comments
 (0)