dart_release 0.2.7 dart_release: ^0.2.7 copied to clipboard
A tool for building and publishing Dart apps, e.g. on GitHub or deploying on a Web Server.
dart_release #
A tool for building and publishing Dart apps, e.g. on GitHub or deploying on a Web Server. See also the according GitHub action.
Example #
Build:
dart_release build \
--main-path "bin/example.dart"
--app-name example \
--app-version v0.0.1-alpha.1 \
--build-arg=--define=DB_USER=user \
--build-arg=--define=DB_PASSWORD=12345678 \
--include-path README.md
If the command is not found (in the PATH), try: dart pub global run dart_release ...
.
Note that you have to pass the base64 arguments without any newline characters:
MY_BASE_64=$(base64 --wrap=0 /myfile)
Or remove them afterward:
MY_BASE_64="${MY_BASE_64//$'\n'/}"
Options: #
main-path
: The Dart entry pointapp-name
: The name of the app executableapp-version
: Semantic version of the release (likev1.2.3
), see https://semver.org/
Supported Features #
Platform | Windows | macOS | Linux |
---|---|---|---|
Build | windows | macos | linux |
Publish | Microsoft Store ❌ | Home Brew ❌ | Snap ❌ |
Deploy | Windows Server ❌ | Mac Server ❌ | Linux Server ✓ |
Support for other app distributors is planned.
Deploy Setup #
- Generate a key pair on your client
ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519_dart_release -C dart_release
* without* a passphrase - Add the output of
cat $HOME/.ssh/id_ed25519_dart_release.pub
to your servers$HOME/.ssh/authorized_keys
- Convert the private key to a base64 string e.g.
base64 --wrap=0 $HOME/.ssh/id_ed25519_dart_release
- Run dart_release
dart_release deploy \ --dry-run \ --app-name example \ --app-version v0.0.1-alpha.1 \ --build-arg=--define=DB_USER=user \ --build-arg=--define=DB_PASSWORD=12345678 \ --host=host.example.com \ --path=.local/share/example/ \ --ssh-port=22 \ --ssh-user=<user> \ --ssh-private-key-base64=<private-key> \ --main-path bin/example.dart \ --include-path public \ --include-path .env.example \ --pre-script deploy-pre-run.sh \ --post-script deploy-post-run.sh