Skip to content

Commit

Permalink
Refactor matrix output format
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed Jun 3, 2024
1 parent 8afcff8 commit a09f8ef
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
steps:
- uses: flutter-actions/setup-flutter@v3
with:
version: ${{ matrix.flutter }}
version: ${{ matrix.release.flutter }}
channel: stable
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ inputs:
default: "false"
outputs:
matrix:
description: 'The `matrix` data (Array<{dart: string, flutter: string}>)'
description: 'The `matrix` data (<{ release: {dart: string, flutter: string} }>)'
dart:
description: 'The Dart SDK versions (Array<string>)'
flutter:
Expand Down
6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function main() {

// Prepare the matrix for the Dart and Flutter SDK versions
const outputs = {
matrix: [],
release: [],
dart: [],
flutter: [],
}
Expand Down Expand Up @@ -118,7 +118,7 @@ async function main() {

// Add value to outputs
if (!outputs.flutter.includes(flutter_sdk_version)) {
outputs.matrix.push({ flutter: flutter_sdk_version, dart: dart_sdk_version })
outputs.release.push({ flutter: flutter_sdk_version, dart: dart_sdk_version })
}
outputs.flutter.push(flutter_sdk_version)
outputs.dart.push(dart_sdk_version)
Expand Down Expand Up @@ -152,7 +152,7 @@ async function main() {
await core.group("Matrix summary", () => core.info(JSON.stringify(outputs, null, 2)))

// Set the output variables
core.setOutput('matrix', JSON.stringify({ matrix: outputs.matrix }))
core.setOutput('matrix', JSON.stringify({ release: outputs.release }))
if ('dart' in outputs) {
core.setOutput('dart', JSON.stringify(outputs.dart))
}
Expand Down

0 comments on commit a09f8ef

Please sign in to comment.