Skip to content

Commit d6510cc

Browse files
authored
ci: Fix Debian installer (#360)
- Ensure `celest` is installed to PATH - Ensure .deb is generated with correct architecture
1 parent 292b5e4 commit d6510cc

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
chmod +x /opt/celest/celest
4+
ln -sf /opt/celest/celest /usr/local/bin/celest
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
rm -f /usr/local/bin/celest

apps/cli/tool/release.dart

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'dart:io' show ProcessException, stderr, stdout;
55
import 'package:archive/archive_io.dart';
66
import 'package:args/args.dart';
77
import 'package:celest_cli/src/context.dart';
8-
import 'package:celest_cli/src/utils/error.dart';
98
import 'package:celest_cli/src/version.dart';
109
import 'package:file/file.dart';
1110
import 'package:mustache_template/mustache.dart';
@@ -24,11 +23,6 @@ final Directory buildDir = fileSystem.directory(
2423
final Directory outputsDir = toolDir.parent.childDirectory('releases')
2524
..createSync();
2625

27-
/// The directory to use for temporary (non-bundled) files.
28-
final Directory tempDir = fileSystem.systemTempDirectory.createTempSync(
29-
'celest_build_',
30-
);
31-
3226
/// The current ABI which identifies the OS and architecture.
3327
final Abi osArch = Abi.current();
3428
final String hostOs = switch (osArch) {
@@ -158,6 +152,11 @@ abstract class Bundler {
158152
'celest_cli-$os-$arch.$extension',
159153
);
160154

155+
/// The directory to use for temporary (non-bundled) files.
156+
final Directory tempDir = fileSystem.systemTempDirectory.createTempSync(
157+
'celest_build_',
158+
);
159+
161160
/// Bundles the CLI and its dependencies into a single file, performing
162161
/// code signing and notarization as needed.
163162
Future<void> bundle();
@@ -205,6 +204,8 @@ final class LinuxDebBundler extends Bundler {
205204
///
206205
/// DEBIAN/
207206
/// control
207+
/// postinst
208+
/// postrm
208209
/// opt/
209210
/// celest/
210211
/// celest
@@ -224,11 +225,7 @@ final class LinuxDebBundler extends Bundler {
224225
final outputControl = Template(
225226
controlFile.readAsStringSync(),
226227
).renderString({
227-
'arch': switch (osArch) {
228-
Abi.linuxArm64 => 'arm64',
229-
Abi.linuxX64 => 'amd64',
230-
_ => unreachable(),
231-
},
228+
'arch': arch,
232229
'version': version,
233230
});
234231
print('Writing control contents:\n\n$outputControl\n');

0 commit comments

Comments
 (0)