release_updater는 로컬 디렉터리 내의 릴리스 또는 설치 파일을 자동으로 업데이트하는 과정을 단순화하는 Flutter/Dart 패키지입니다. 개발자가 앱 바이너리나 구성 파일과 같은 버전 관리 리소스를 원격 소스에서 가져와 교체할 수 있도록 지원합니다. 완전한 재설치 없이 자주 업데이트가 필요한 앱에 적합하며, Android, iOS, macOS, Windows, Linux 등 여러 플랫폼을 지원합니다. 이 패키지는 수동 파일 관리를 줄이고 환경 간 일관성을 보장함으로써 배포 워크플로우를 간소화합니다.
사용 사례
앱 자산 업데이트 자동화
버전이 있는 설치 파일 관리
로컬 빌드를 원격 릴리스와 동기화
CI/CD 파이프라인 간소화
배포 후 구성 파일 업데이트
주요 기능
자동 파일 교체
원격 소스 통합
크로스 플랫폼 지원
간단한 CLI 명령
버전 인식 업데이트
적합한 대상
자주 업데이트되는 앱을 관리하는 개발자
자동 배포 워크플로를 사용하는 팀
분산 빌드 아티팩트를 가진 프로젝트
CI/CD 파이프라인 통합
로컬 파일 동기화가 필요한 앱
고려 사항
업데이트를 위해 네트워크 액세스가 필요합니다
원격 소스 구성에 대한 수동 설정
로컬 디렉터리 업데이트에 한정
런타임 앱 업데이트를 위한 것이 아님
외부 파일의 가용성에 따라 달라집니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
release_updater
This package brings a simple way to automatically update release/installation files in a local directory.
It also comes with built-in CLI tools to easily generate a release bundle (Zip file) or
serve release files for multiple platforms.
Motivation
Since Dart can run in many native platforms (Linux/x64, macOS/x64/arm64, Windows/x86),
it's not simple to manage all the different releases+platforms files that a
compiled Dart application can have.
In the same way that modern Browsers, and many other applications,
can have automatic builds and updates for multiple platforms, this package
provides tools and an API to easily achieve that.
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';
voidmain() 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.
CLI Tools
release_updater: A CLI updater.
release_updater_server: A simple HTTP server to provide releases using the shelf package.
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.
windows_gui: Changes an executable Windows Subsistem to GUI.
command: performs a shell %command.
rm: Deletes a file.
upload_release: uploads the generated release.
url: release server base URL.
authorization: HTTP basic authorization.
username: authentication username.
password: authentication password.
Command errors:
A command that fails aborts the build: the error is logged, the
remaining commands are NOT executed, and the release_packer CLI
exits with code 1. This avoids a silent error generating and
releasing an incomplete package/artifact.
Some commands are just ignored (skipped) when not applicable, and do
NOT abort the build:
rm of a file that doesn't exist.
windows_gui over a file that is not a Windows executable (the usual
case when building on another platform).
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.