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

enhance set output

This commit is contained in:
Alif Rachmawadi 2022-09-08 08:41:22 +07:00
parent 1e952778af
commit de3cdb9a4b
No known key found for this signature in database
GPG key ID: 19EE1E10C3733F31
3 changed files with 39 additions and 1 deletions

View file

@ -22,9 +22,18 @@ jobs:
channel: [stable, beta, master] channel: [stable, beta, master]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: ./ - id: flutter-action
uses: ./
with: with:
channel: ${{ matrix.channel }} channel: ${{ matrix.channel }}
- name: Echo outputs
run: |
echo cache-path=${{ steps.flutter-action.outputs.cache-path }}
echo cache-key=${{ steps.flutter-action.outputs.cache-key }}
echo channel=${{ steps.flutter-action.outputs.channel }}
echo version=${{ steps.flutter-action.outputs.version }}
echo architecture=${{ steps.flutter-action.outputs.architecture }}
shell: bash
- run: dart --version - run: dart --version
shell: bash shell: bash
- run: flutter --version - run: flutter --version

View file

@ -171,3 +171,21 @@ Note: `cache-key` and `cache-path` has support for several dynamic values:
- `:arch:` - `:arch:`
- `:hash:` - `:hash:`
- `:sha256:` - `:sha256:`
Use outputs from `flutter-action`:
```yaml
steps:
- uses: actions/checkout@v3
- id: flutter-action
uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: |
echo cache-path=${{ steps.flutter-action.outputs.cache-path }}
echo cache-key=${{ steps.flutter-action.outputs.cache-key }}
echo channel=${{ steps.flutter-action.outputs.channel }}
echo version=${{ steps.flutter-action.outputs.version }}
echo architecture=${{ steps.flutter-action.outputs.architecture }}
shell: bash
```

View file

@ -29,6 +29,17 @@ inputs:
description: 'The architecture of Flutter SDK executable (x64 or arm64)' description: 'The architecture of Flutter SDK executable (x64 or arm64)'
required: false required: false
default: '${{ runner.arch }}' default: '${{ runner.arch }}'
outputs:
cache-path:
value: '${{ steps.flutter-action.outputs.cache-path }}'
cache-key:
value: '${{ steps.flutter-action.outputs.cache-key }}'
channel:
value: '${{ steps.flutter-action.outputs.channel }}'
version:
value: '${{ steps.flutter-action.outputs.version }}'
architecture:
value: '${{ steps.flutter-action.outputs.architecture }}'
runs: runs:
using: 'composite' using: 'composite'
steps: steps: