fix(release): a snap built in a clone of its own is packed inside it, then moved into the release's folder
snapcraft packs nowhere outside the project it builds, so Todo 0.1.0's release stopped
after its snap was built ("Cannot create packages outside of the project tree").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
f51e3ab2b1
commit
34001b1aff
2 changed files with 37 additions and 1 deletions
|
|
@ -215,4 +215,14 @@ final class const SnapRelease({
|
|||
/// does for the root's, and outside the repository, which the checks would
|
||||
/// otherwise analyse.
|
||||
String projectPath(String home) => '$home/.cache/halkyon-release/snap/$name';
|
||||
|
||||
/// Where `snapcraft pack` writes the snap: the release's folder ([out] in
|
||||
/// [root]) for the root's, its clone for any other, as snapcraft packs
|
||||
/// nowhere outside the project it builds (found releasing Todo 0.1.0, 3 Nov
|
||||
/// 2026); the release tool moves it into the release's folder from there.
|
||||
String packPath({
|
||||
required String home,
|
||||
required String root,
|
||||
required String out,
|
||||
}) => atRoot ? '$root/$out' : projectPath(home);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -454,11 +454,21 @@ final class Releaser({
|
|||
'clean',
|
||||
snap.part,
|
||||
], workingDirectory: project);
|
||||
final packed = snap.packPath(
|
||||
home: Platform.environment['HOME'] ?? '',
|
||||
root: root.path,
|
||||
out: out,
|
||||
);
|
||||
await _run('snapcraft', [
|
||||
'pack',
|
||||
'--output',
|
||||
p.join(root.path, out),
|
||||
packed,
|
||||
], workingDirectory: project);
|
||||
if (!snap.atRoot) {
|
||||
File(p.join(packed, snapFile))
|
||||
..copySync(p.join(root.path, out, snapFile))
|
||||
..deleteSync();
|
||||
}
|
||||
await _checkSnap(p.join(out, snapFile), version);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue