Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2783a3f08e | ||
|
|
c33c37022b | ||
|
|
cc97e1648f | ||
|
|
ed388baf1d |
10
.github/workflows/workflow.yml
vendored
10
.github/workflows/workflow.yml
vendored
@@ -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
|
||||
|
||||
14
README.md
14
README.md
@@ -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
|
||||
@@ -158,7 +170,7 @@ steps:
|
||||
channel: 'stable'
|
||||
cache: true
|
||||
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache
|
||||
cache-path: ${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch: # optional, change this to specify the cache path
|
||||
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path
|
||||
architecture: x64 # optional, x64 or arm64
|
||||
- run: flutter --version
|
||||
```
|
||||
|
||||
@@ -43,6 +43,8 @@ outputs:
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- run: chmod +x $GITHUB_ACTION_PATH/setup.sh
|
||||
shell: bash
|
||||
- id: flutter-action
|
||||
run: $GITHUB_ACTION_PATH/setup.sh -p -c '${{ inputs.cache-path }}' -k '${{ inputs.cache-key }}' -n '${{ inputs.flutter-version }}' -a '${{ inputs.architecture }}' ${{ inputs.channel }}
|
||||
shell: bash
|
||||
|
||||
14
setup.sh
14
setup.sh
@@ -48,13 +48,15 @@ download_archive() {
|
||||
mkdir -p "$2"
|
||||
|
||||
if [[ "$archive_name" == *zip ]]; then
|
||||
unzip -q -o "$archive_local" -d "$RUNNER_TEMP"
|
||||
# Remove the folder again so that the move command can do a simple rename
|
||||
EXTRACT_PATH="$RUNNER_TEMP/_unzip_temp"
|
||||
unzip -q -o "$archive_local" -d "$EXTRACT_PATH"
|
||||
# Remove the folder again so that the move command can do a simple rename\
|
||||
# instead of moving the content into the target folder.
|
||||
# This is a little bit of a hack since the "mv --no-target-directory"
|
||||
# linux option is not available here
|
||||
rm -r "$2"
|
||||
mv "$RUNNER_TEMP"/flutter "$2"
|
||||
mv "$EXTRACT_PATH"/flutter "$2"
|
||||
rm -r "$EXTRACT_PATH"
|
||||
else
|
||||
tar xf "$archive_local" -C "$2" --strip-components=1
|
||||
fi
|
||||
@@ -97,7 +99,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 +159,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"
|
||||
|
||||
Reference in New Issue
Block a user