release_updater 1.0.13 copy "release_updater: ^1.0.13" to clipboard
release_updater: ^1.0.13 copied to clipboard

outdated

A simple way to update release/installation files in a local directory.

release_updater #

pub package Null Safety Codecov CI GitHub Tag New Commits Last Commits Pull Requests Code size License

This package brings a simple way to update release/installation files in a local directory.

API Documentation #

See the API Documentation for a full list of functions, classes and extension.

Usage #

import 'dart:io';

import 'package:release_updater/release_updater_io.dart';

void main() async {
  var storage = ReleaseStorageDirectory('appx', Directory('/install/path'));
  
  var provider = ReleaseProviderHttp.baseURL('https://your.domain/appx/releases');

  var releaseUpdater = ReleaseUpdater(storage, provider);

  var version = await releaseUpdater.update();

  print('-- Updated to version: $version');

  var runResult = await releaseUpdater.runReleaseProcess('run.exe', ['-a']);

  var exitCode = runResult!.exitCode;
  
  print('-- Exit code: $exitCode');
  print('-- Result: ${runResult.stdout}');

  exit(exitCode);
}

ReleaseProvider #

You can implement your own ReleaseProvider or use just the built-in ReleaseProviderHttp class.

Executables #

  • release_updater: A CLI updater.

  • release_updater_server: A simple HTTP server to provide releases using the shelf package.

release_updater #

The release_updater is a CLI for the ReleaseUpdater class.

To build a release:

$> release_packer release_packer.json build ./source-dir ./releases-dir

Example of a release_packer.json file:

{
  "name": "appx",
  "version_from": "pubspec.yaml",
  "prepare": [
    "dart_pub_get",
    {"dart_compile_exe": "bin/foo.dart"}
  ],
  "finalize": [
    {"rm": "bin/foo.exe"}
  ],
  "files": [
    "README.md",
    {"hello.txt": "hello-world.txt"},
    {"bin/foo.exe": "."},
    {"libfoo-arm64.dylib": ".", "platform":  "^macos-arm64$"},
    {"libfoo-x64.dylib": ".", "platform":  "^macos-x64$"},
    {"libfoo.so": ".", "platform":  "^linux.*$"},
    {"libfoo.dll": ".", "platform":  "^windows.*$"}
  ]
}

JSON Format:

  • name: the application name, for the Release name.

  • version: the version of the Release.

  • version_from: the JSON or YAML file to provide the field version (if the parameter field is not provided).

  • platform: is a RegExp string to match the building platform. See the ReleasePlatform class.

  • Command types:

    • dart_pub_get: performs a dart pub get.
    • dart_compile_exe: performs a dart compile exe %dart_script.
    • dart: performs a dart %command.
    • command: performs a shell %command.
    • rm: Deletes a file.
  • files: each entry of files can be:

    • A String with a file path:
      "file/path.txt"
      
    • A Map with extra parameters:
      • A file with a renamed path and a specific platform.
        {"source/file/path.txt": "release/file/path", "platform": "^regexp"}
        
      • A file without rename it:
        {"source/file/path.txt": "."}
        
      • A file from a dart_compile_exe command:
        {"bin/client.exe": "client.exe", "dart_compile_exe": "bin/client.dart"}
        

release_updater_server #

To serve a release directory:

$> release_updater_server releases-server-config.json

Config file:

{
  "releases-directory": "/path/to/releases",
  "port": 8090,
  "address": "0.0.0.0",
  "upload-user": "userx",
  "upload-pass": "123456"
}
  • If the properties upload-user and upload-pass (with length >= 6) are defined, upload of files will be allowed.
    • All files are saved in the releases-directory without any sub-directory.
    • Upload errors can block an IP for 30min.
  • A high volume of requests can block an IP for 2min.

Source #

The official source code is hosted @ GitHub:

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Contribution #

Any help from the open-source community is always welcome and needed:

  • Found an issue?
    • Please fill a bug report with details.
  • Wish a feature?
    • Open a feature request with use cases.
  • Are you using and liking the project?
    • Promote the project: create an article, do a post or make a donation.
  • Are you a developer?
    • Fix a bug and send a pull request.
    • Implement a new feature, like other training algorithms and activation functions.
    • Improve the Unit Tests.
  • Have you already helped in any way?
    • Many thanks from me, the contributors and everybody that uses this project!

If you donate 1 hour of your time, you can contribute a lot, because others will do the same, just be part and start with your 1 hour.

Author #

Graciliano M. Passos: gmpassos@GitHub.

License #

Apache License - Version 2.0

28
likes
0
pub points
56%
popularity

Publisher

unverified uploader

A simple way to update release/installation files in a local directory.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

archive, collection, mercury_client, path, pub_semver, shelf, shelf_gzip, shelf_static, yaml

More

Packages that depend on release_updater