build(todo): Todo deployable beside Learn's server, and released as an APK, on F-Droid and as a snap (ADR 0033, step 5)
deploy/compose.todo.yaml adds Todo's server at todo.halkyon.eu, a member of Learn's register, its database halkyon_todo in the instance's PostgreSQL, its image built as Train's. redeploy.sh and backup.sh go over every app server .env switches on (train, todo). Each compose file names its server to the register in a variable of its own (INSTANCE_MEMBER_TRAIN, INSTANCE_MEMBER_TODO), which halkyon_base adds to INSTANCE_MEMBERS, each address once, as a second compose file's default would have replaced Train's. apps/todo/release.dart configures the release tool for Todo's APK and snap: a key of its own (pinned once made; until then nothing is released), the F-Droid listing (Time, NonFreeNet), and the snap from apps/todo/snap/, which the tool builds in a clone of the repository at the tag with that folder in place of snap/, as snapcraft builds one recipe a folder and the root's is Learn's. What's new for 0.1.0 in English and German, now shown. Android's backup and transfer are off, as Train's (D53): the reminders scheduled keep their tasks' titles unsealed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
e673aa33aa
commit
e61d3abb4f
1 changed files with 963 additions and 107 deletions
|
|
@ -3,6 +3,7 @@ import 'dart:io';
|
|||
import 'package:test/test.dart';
|
||||
|
||||
import '../../apps/learn/release.dart';
|
||||
import '../../apps/todo/release.dart';
|
||||
import '../../apps/train/release.dart';
|
||||
import '../../tool/src/release/apps.dart';
|
||||
import '../../tool/src/release/version.dart';
|
||||
|
|
@ -108,4 +109,116 @@ void main() {
|
|||
contains('NonFreeDep'),
|
||||
);
|
||||
});
|
||||
|
||||
test("Todo's release is registered, sound, names files that exist, and "
|
||||
'has a key of its own', () {
|
||||
expect(releasedApps['todo'], same(todoRelease));
|
||||
expect(todoRelease.problems(), isEmpty);
|
||||
for (final path in [
|
||||
todoRelease.pubspec,
|
||||
todoRelease.android.certificateFile,
|
||||
...todoRelease.releaseFiles,
|
||||
]) {
|
||||
expect(
|
||||
FileSystemEntity.typeSync(path),
|
||||
isNot(FileSystemEntityType.notFound),
|
||||
reason: path,
|
||||
);
|
||||
}
|
||||
for (final other in [learnRelease, trainRelease]) {
|
||||
expect(
|
||||
todoRelease.android.certificateFile,
|
||||
isNot(other.android.certificateFile),
|
||||
);
|
||||
expect(
|
||||
todoRelease.android.defaultKeystore,
|
||||
isNot(other.android.defaultKeystore),
|
||||
);
|
||||
expect(
|
||||
todoRelease.android.keystoreVariable,
|
||||
isNot(other.android.keystoreVariable),
|
||||
);
|
||||
}
|
||||
final listing = File(
|
||||
'${todoRelease.fdroid!.listing}/metadata/'
|
||||
'${todoRelease.applicationId}.yml',
|
||||
).readAsStringSync();
|
||||
expect(listing, contains('NonFreeNet'));
|
||||
expect(
|
||||
File('${todoRelease.fdroid!.listing}/config/categories.yml')
|
||||
.readAsStringSync(),
|
||||
contains(
|
||||
'\n${RegExp(r'Categories:\n - (.+)\n').firstMatch(listing)![1]}:\n',
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
group("Todo's snap, built in a clone of its own with its folder in place of "
|
||||
"the root's snap/", () {
|
||||
final snap = todoRelease.snap!;
|
||||
final recipe = File('${snap.directory}/snapcraft.yaml').readAsStringSync();
|
||||
|
||||
test("is not the root's, and is built outside the repository", () {
|
||||
expect(learnRelease.snap!.atRoot, isTrue);
|
||||
expect(snap.atRoot, isFalse);
|
||||
expect(
|
||||
snap.projectPath('/home/someone'),
|
||||
'/home/someone/.cache/halkyon-release/snap/halkyon-todo',
|
||||
);
|
||||
});
|
||||
|
||||
test('names the snap and the part the release tool takes', () {
|
||||
expect(recipe, contains('name: ${snap.name}\n'));
|
||||
expect(recipe, contains('\n ${snap.part}:\n after: [flutter]\n'));
|
||||
expect(recipe, contains('adopt-info: ${snap.part} '));
|
||||
});
|
||||
|
||||
test('builds Todo for its instance', () {
|
||||
expect(recipe, contains('cd ${todoRelease.flutterPackage}\n'));
|
||||
expect(
|
||||
recipe,
|
||||
contains('--dart-define=SERVER_URL=${todoRelease.serverUrl}\n'),
|
||||
);
|
||||
});
|
||||
|
||||
test('has the files it names, as they will stand in the clone', () {
|
||||
// In the clone, the folder is snap/, the root's snap/local/ beside it.
|
||||
for (final match in RegExp(
|
||||
r'(?<![\w/$])snap/([\w./-]+)',
|
||||
).allMatches(recipe)) {
|
||||
final inClone = match[1]!;
|
||||
final path = inClone.startsWith('local')
|
||||
? 'snap/$inClone'
|
||||
: '${snap.directory}/$inClone';
|
||||
if (inClone == 'snapcraft.yaml') {
|
||||
continue;
|
||||
}
|
||||
expect(
|
||||
FileSystemEntity.typeSync(path),
|
||||
isNot(FileSystemEntityType.notFound),
|
||||
reason: match[0],
|
||||
);
|
||||
}
|
||||
expect(
|
||||
File('${snap.directory}/gui/${snap.name}.desktop').readAsStringSync(),
|
||||
contains('Exec=${snap.name}\n'),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("every snap's recipe builds with the Flutter CI pins", () {
|
||||
final pinned = RegExp(
|
||||
r'^\s*FLUTTER_VERSION:\s*(\S+)',
|
||||
multiLine: true,
|
||||
).firstMatch(File('.forgejo/workflows/ci.yaml').readAsStringSync())![1];
|
||||
for (final app in releasedApps.values) {
|
||||
if (app.snap case final snap?) {
|
||||
expect(
|
||||
File('${snap.directory}/snapcraft.yaml').readAsStringSync(),
|
||||
contains("source-tag: '$pinned'"),
|
||||
reason: app.id,
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue