shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
1.97k stars 118 forks source link

feat: Custom Shorebird Cli version while using shell script #1946

Closed canewsin closed 3 weeks ago

canewsin commented 3 weeks ago

Description

curl --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/shorebirdtech/install/main/install.sh -sSf | bash **shorebird_version_here**

Requirements

felangel commented 3 weeks ago

You can still use the latest version of Shorebird CLI to patch older releases and you can also create releases with older flutter versions. Does that help? Thanks!

canewsin commented 3 weeks ago

@felangel currently we can't customize flutter revision, if we use latest version, shorebird currently building with available version then verifies that version incompatibility and then downloads compatible flutter engine and builds app, resulted in valuable ci minutes. recent issue i found after this issue is shorebird stops building patch if our shorebird version is outdated which should not be default for customization.

felangel commented 3 weeks ago

@felangel currently we can't customize flutter revision, if we use latest version, shorebird currently building with available version then verifies that version incompatibility and then downloads compatible flutter engine and builds app, resulted in valuable ci minutes. recent issue i found after this issue is shorebird stops building patch if our shorebird version is outdated which should not be default for customization.

You can pass --flutter-version to the release command to use an arbitrary flutter version regardless of what version of shorebird cli you have installed. To patch an older release you can specify the --release-version option to specify the exact release you want to patch and shorebird will not try to build your app with the latest stable flutter version. Hope that helps, you’re not the first person to be confused by this so we will likely improve the UX and documentation in the near future (see #1945)

canewsin commented 3 weeks ago

Why can't we determine Flutter Version before building patch here? I just made only dart related changes, still shorebird says native changes are made. Does shorebird relies on CI's Installed Flutter SDK ?

⠋ Fetching apps...
✓ Fetching apps (0.2s)
⠋ Building patch with Flutter 3.19.5 (47571af6a3)...
✓ Building patch with Flutter 3.19.5 (47571af6a3) (352.0s)
⠋ Detecting release version...
✓ Detected release version 1.0.0+100 (0.4s)
⠋ Fetching releases...
✓ Fetching releases (0.1s)

The release you are trying to patch was built with a different version of Flutter.

Release Flutter Revision: 25bc2b57a159f5b52385c4adb5c80f6ed25ae6d5
Current Flutter Revision: 47571af6a3acdebedf88255099ff1de1c3324049

⠋ Installing Flutter 3.19.5 (25bc2b57a1)...
✓ Installing Flutter 3.19.5 (25bc2b57a1) (8.1s)
⠋ Building patch...
✓ Building patch (190.9s)
⠋ Fetching release artifacts...
✓ Fetching release artifacts (0.3s)
⠋ Fetching aab artifact...
✓ Fetching aab artifact (97ms)
⠋ Downloading release artifacts...
✓ Downloading release artifacts (2.3s)
⠋ Verifying patch can be applied to release...
✓ Verifying patch can be applied to release (32ms)
[WARN] Your app contains native changes, which cannot be applied with a patch.
    Changed files:
        base/dex/classes.dex
        base/dex/classes2.dex

If you don't know why you're seeing this error, visit our troublshooting page at ]8;;https://docs.shorebird.dev/troubleshooting#unexpected-native-changes\https://docs.shorebird.dev/troubleshooting#unexpected-native-changes]8;;\
Exiting.

If you aren't sure why this command failed, re-run with the --verbose flag to see more information.

Build failed :|
Step 6 script `Build AAB with Shorebird` exited with status code 70
felangel commented 3 weeks ago

Shorebird builds the app so it can determine the release version. It’s not enough to look at the pubspec.yaml since that version can be overridden in your gradle, info.plist, custom scripts/command line args, etc. If you provide the release version via command line to the patch command shorebird will skip this step and use the provided release version instead.

canewsin commented 3 weeks ago

--flutter-version

I previously looked for this option, hadn't found anywhere.

shorebird patch android --help


Publish new patches for a specific Android release to Shorebird.

Usage: shorebird patch android [arguments] -h, --help Print this usage information. -t, --target The main entrypoint file of the application. --flavor The product flavor to use when building the app. --release-version The version of the release being patched (e.g. "1.0.0+1").

                        If this option is not provided, the version number will be determined from the patch artifact.
--allow-native-diffs    Patch even if native code diffs are detected.
                        NOTE: this is not recommended. Native code changes cannot be included in a patch and attempting to do so can cause your app to crash or behave unexpectedly.
--allow-asset-diffs     Patch even if asset diffs are detected.
                        NOTE: this is not recommended. Asset changes cannot be included in a patch can cause your app to behave unexpectedly.

-n, --dry-run Validate but do not upload the patch. --staging Whether to publish the patch to the staging environment.

Run "shorebird help" to see global options.

felangel commented 3 weeks ago

--flutter-version

I previously looked for this option, hadn't found anywhere.

shorebird patch android --help

Publish new patches for a specific Android release to Shorebird.

Usage: shorebird patch android [arguments]
-h, --help                  Print this usage information.
-t, --target                The main entrypoint file of the application.
    --flavor                The product flavor to use when building the app.
    --release-version       The version of the release being patched (e.g. "1.0.0+1").

                            If this option is not provided, the version number will be determined from the patch artifact.
    --allow-native-diffs    Patch even if native code diffs are detected.
                            NOTE: this is not recommended. Native code changes cannot be included in a patch and attempting to do so can cause your app to crash or behave unexpectedly.
    --allow-asset-diffs     Patch even if asset diffs are detected.
                            NOTE: this is not recommended. Asset changes cannot be included in a patch can cause your app to behave unexpectedly.
-n, --dry-run               Validate but do not upload the patch.
    --staging               Whether to publish the patch to the staging environment.

Run "shorebird help" to see global options.

The flutter-version option is only available for the release command. For the patch command you can specify a release version to avoid building your app with the latest stable flutter version (in order to determine the release version).

bryanoltman commented 3 weeks ago

I believe this is resolved, closing. Please reopen if I'm mistaken.