1
0
Fork 0
mirror of https://github.com/subosito/flutter-action.git synced 2024-08-16 10:19:50 +02:00

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

* feat: Allow git ref as version in `master` channel

* fix lint

* fix parsing

* fix test

* fix checkout, add tests

* replace with tab
This commit is contained in:
Gustl22 2023-10-11 10:55:21 +02:00 committed by GitHub
parent ed388baf1d
commit cc97e1648f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 3 deletions

View file

@ -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
@ -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

View file

@ -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

View file

@ -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
@ -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"