Skip to content

Commit d9c4a4a

Browse files
committed
Improve app and add more install options (and fix old .dmg files)
1 parent 77dcea1 commit d9c4a4a

File tree

20 files changed

+1423
-195
lines changed

20 files changed

+1423
-195
lines changed

.github/workflows/build-and-release.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ jobs:
3131
- name: Install dependencies
3232
run: npm install
3333

34+
- name: Build (ia32)
35+
run: npm run build -- --arch ia32
36+
3437
- name: Build (x64)
3538
run: npm run build -- --arch x64
3639

@@ -49,6 +52,8 @@ jobs:
4952
- name: Generate checksum
5053
run: |
5154
sha256sum dist/*.AppImage > dist/sha256sum.txt
55+
sha256sum dist/*.deb >> dist/sha256sum.txt
56+
sha256sum dist/*.zip >> dist/sha256sum.txt
5257
5358
- name: Upload Linux Artifacts
5459
uses: actions/upload-artifact@v4
@@ -57,14 +62,15 @@ jobs:
5762
name: linux-artifacts
5863
path: |
5964
dist/*.AppImage
65+
dist/*.deb
66+
dist/*.zip
6067
dist/latest*.yml
6168
dist/sha256sum.txt
6269
6370
build-windows:
6471
name: Build bsky-desktop (Windows)
6572
runs-on: windows-latest
6673
env:
67-
ext: "exe"
6874
GITHUB_TOKEN: ${{ secrets.GHT }}
6975

7076
steps:
@@ -78,16 +84,22 @@ jobs:
7884

7985
- name: Install dependencies
8086
run: npm install
87+
88+
- name: Build (ia32)
89+
run: npm run build -- --arch ia32
8190

8291
- name: Build (x64)
8392
run: npm run build -- --arch x64
84-
93+
8594
- name: Build (arm64)
8695
run: npm run build -- --arch arm64
8796

8897
- name: Generate checksum
8998
run: |
9099
sha256sum dist/*.exe > dist/sha256sum.txt
100+
sha256sum dist/*.msi >> dist/sha256sum.txt
101+
sha256sum dist/*.appx >> dist/sha256sum.txt
102+
sha256sum dist/*.zip >> dist/sha256sum.txt
91103
92104
- name: Upload Windows Artifacts
93105
uses: actions/upload-artifact@v4
@@ -96,14 +108,16 @@ jobs:
96108
name: windows-artifacts
97109
path: |
98110
dist/*.exe
111+
dist/*.msi
112+
dist/*.appx
113+
dist/*.zip
99114
dist/latest*.yml
100115
dist/sha256sum.txt
101116
102117
build-macos:
103118
name: Build bsky-desktop (macOS)
104119
runs-on: macos-latest
105120
env:
106-
ext: "dmg"
107121
GITHUB_TOKEN: ${{ secrets.GHT }}
108122

109123
steps:
@@ -127,6 +141,8 @@ jobs:
127141
- name: Generate checksum
128142
run: |
129143
shasum -a 256 dist/*.dmg > dist/sha256sum.txt
144+
shasum -a 256 dist/*.pkg >> dist/sha256sum.txt
145+
shasum -a 256 dist/*.zip >> dist/sha256sum.txt
130146
131147
- name: Upload macOS Artifacts
132148
uses: actions/upload-artifact@v4
@@ -135,6 +151,8 @@ jobs:
135151
name: macos-artifacts
136152
path: |
137153
dist/*.dmg
154+
dist/*.pkg
155+
dist/*.zip
138156
dist/latest*.yml
139157
dist/sha256sum.txt
140158
@@ -189,8 +207,15 @@ jobs:
189207
generate_release_notes: true
190208
files: |
191209
dist/linux/*.AppImage
210+
dist/linux/*.deb
211+
dist/linux/*.zip
192212
dist/windows/*.exe
213+
dist/windows/*.msi
214+
dist/windows/*.appx
215+
dist/windows/*.zip
193216
dist/macos/*.dmg
217+
dist/macos/*.pkg
218+
dist/macos/*.zip
194219
sha256sums.txt
195220
196221
aur:

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ Bsky Desktop is an Electron-based application for Bsky that allows users to mana
1414

1515
[![Packaging status](https://repology.org/badge/vertical-allrepos/bskydesktop.svg?columns=4&exclude_unsupported=1)](https://repology.org/project/bskydesktop/versions)
1616

17+
#### Windows install options:
18+
- Zip (x64, arm64, ia32)
19+
- Setup (exe, msi, appx) (x64, arm64, ia32)
20+
21+
#### Mac install options:
22+
- Zip (x64, arm64)
23+
- Dmg (x64, arm64)
24+
- Pkg (x64, arm64)
25+
26+
#### Linux install options:
27+
- Zip (x64, arm64, ia32)
28+
- AppImage (x64, arm64, ia32)
29+
- Deb (x64, arm64, ia32)
30+
1731
### Build Instructions for Bsky Desktop
1832

1933
To build and run Bsky Desktop locally, follow these steps:

build-app.js

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

build/build-app.js

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
const path = require('path');
2+
const process = require('process');
3+
const builder = require('electron-builder');
4+
const { Platform, Arch } = builder;
5+
6+
// Parse command-line arguments
7+
const supportedPlatforms = ['win', 'mac', 'linux'];
8+
const supportedArchitectures = ['x64', 'armv7l', 'arm64', 'ia32', 'universal'];
9+
const args = process.argv.slice(2);
10+
const carch = args.includes('--arch') ? args[args.indexOf('--arch') + 1] : null;
11+
const cplatform = args.includes('--platform') ? args[args.indexOf('--platform') + 1] : null;
12+
const pack = args.includes('--pack'); // Keep track of --pack as a boolean flag
13+
14+
// Determine platform
15+
let platform;
16+
if (!cplatform) {
17+
platform = process.platform === 'win32' ? 'win' :
18+
process.platform === 'darwin' ? 'mac' :
19+
process.platform === 'linux' ? 'linux' : null;
20+
} else if (!supportedPlatforms.includes(cplatform)) {
21+
console.error(`Invalid platform specified. Supported platforms: ${supportedPlatforms.join(', ')}`);
22+
process.exit(1);
23+
} else {
24+
platform = cplatform;
25+
}
26+
27+
// Determine architecture
28+
let arch = carch || (process.arch === 'arm' ? 'armv7l' : process.arch);
29+
if (!supportedArchitectures.includes(arch)) {
30+
console.error(`Invalid architecture specified. Supported architectures: ${supportedArchitectures.join(', ')}`);
31+
process.exit(1);
32+
}
33+
34+
// Map platform and architecture to electron-builder enums
35+
const platformEnum = {
36+
win: Platform.WINDOWS,
37+
mac: Platform.MAC,
38+
linux: Platform.LINUX
39+
}[platform];
40+
41+
const archEnum = {
42+
x64: Arch.x64,
43+
armv7l: Arch.armv7l,
44+
arm64: Arch.arm64,
45+
ia32: Arch.ia32,
46+
universal: Arch.universal
47+
}[arch];
48+
49+
// Additional build arguments: (starting with --eb-)
50+
const buildArgs = args.filter((arg) => arg.startsWith('--eb-'));
51+
52+
// If additional args are present, add them to the buildArgs array
53+
if (buildArgs.length > 0) {
54+
console.log('Additional build arguments:', buildArgs);
55+
}
56+
57+
// If pack is true, add --dir to buildArgs
58+
if (pack) {
59+
buildArgs.push('--dir');
60+
}
61+
62+
// Read build-config.json
63+
const buildConfigPath = path.join(__dirname, 'build-config.json');
64+
let buildConfig;
65+
try {
66+
buildConfig = require(buildConfigPath);
67+
} catch (err) {
68+
console.error(`Failed to read build-config.json: ${err.message}`);
69+
process.exit(1);
70+
}
71+
72+
// Generate artifact name
73+
const packageJson = require('../package.json');
74+
const artifactName = `${buildConfig.productName}-${packageJson.version}-${platform}-${arch}.\${ext}`;
75+
76+
// Electron Builder configuration
77+
/**
78+
* @type {import('electron-builder').Configuration}
79+
*/
80+
const options = {
81+
artifactName,
82+
nsis: {
83+
deleteAppDataOnUninstall: true,
84+
oneClick: true,
85+
perMachine: false
86+
},
87+
dmg: {
88+
contents: [
89+
{ type: 'file', x: 255, y: 85 },
90+
{ type: 'link', path: '/Applications', x: 253, y: 325 }
91+
]
92+
},
93+
...buildConfig
94+
};
95+
96+
// Build process
97+
builder.build({
98+
targets: platformEnum.createTarget(null, archEnum),
99+
config: options
100+
}).then(result => {
101+
console.log("Build completed:", JSON.stringify(result, null, 2));
102+
}).catch(error => {
103+
console.error("Build failed:", error);
104+
});

0 commit comments

Comments
 (0)