Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow git ref as version in master channel #237

Merged
merged 6 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,13 @@ jobs:
shell: bash
- run: ./setup.sh -t -p dev | grep 'flutter-macos-dev-2.11.0-0.1.pre-x64-b101bfe32f634566e7cb2791a9efe19cf8828b15'
shell: bash
- run: ./setup.sh -t -p master | grep 'flutter-macos-master-master-x64-master'
- run: ./setup.sh -t -p master | grep 'flutter-macos-master-any-x64-master'
shell: bash
- run: ./setup.sh -t -p -n 5b12b74 master | grep 'flutter-macos-master-5b12b74-x64-master'
shell: bash
- run: ./setup.sh -t -p -n 3.12.0-12.0.pre master | grep 'flutter-macos-master-3.12.0-12.0.pre-x64-master'
shell: bash
- run: ./setup.sh -t -p -n stable master | grep 'flutter-macos-master-stable-x64-master'
shell: bash
- run: ./setup.sh -t -p -n 2 any | grep 'flutter-macos-beta-2.13.0-0.4.pre-x64-25caf1461b8f643092a9f6f5b224453b5c057d10'
shell: bash
Expand All @@ -123,7 +129,7 @@ jobs:
shell: bash
- run: ./setup.sh -t -p dev | grep '/Users/runner/work/_temp/flutter/dev-2.11.0-0.1.pre-x64'
shell: bash
- run: ./setup.sh -t -p master | grep '/Users/runner/work/_temp/flutter/master-master-x64'
- run: ./setup.sh -t -p master | grep '/Users/runner/work/_temp/flutter/master-any-x64'
shell: bash
- run: ./setup.sh -t -p -k 'custom-:channel:-:version:-:hash:' | grep 'custom-stable-3.7.7-2ad6cd72c040113b47ee9055e722606a490ef0da'
shell: bash
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ steps:
- run: flutter --version
```

Use particular git reference on master channel:

```yaml
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '5b12b74' # tag, commit or branch
channel: 'master'
- run: flutter --version
```

Build Android APK and app bundle:

```yaml
Expand Down
6 changes: 5 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ else
fi

if [[ "$CHANNEL" == "master" ]]; then
VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$CHANNEL\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}"
VERSION_MANIFEST="{\"channel\":\"$CHANNEL\",\"version\":\"$VERSION\",\"dart_sdk_arch\":\"$ARCH\",\"hash\":\"$CHANNEL\",\"sha256\":\"$CHANNEL\"}"
else
VERSION_MANIFEST=$(echo "$RELEASE_MANIFEST" | filter_by_channel "$CHANNEL" | filter_by_arch "$ARCH" | filter_by_version "$VERSION")
fi
Expand Down Expand Up @@ -157,6 +157,10 @@ fi
if [[ ! -x "$CACHE_PATH/bin/flutter" ]]; then
if [[ "$CHANNEL" == "master" ]]; then
git clone -b master https://github.com/flutter/flutter.git "$CACHE_PATH"
if [[ "$VERSION" != "any" ]]; then
git config --global --add safe.directory "$CACHE_PATH"
(cd "$CACHE_PATH" && git checkout "$VERSION")
fi
else
archive_url=$(echo "$VERSION_MANIFEST" | jq -r '.archive')
download_archive "$archive_url" "$CACHE_PATH"
Expand Down