Skip to content

Commit

Permalink
Add tasks and deployment action
Browse files Browse the repository at this point in the history
  • Loading branch information
PlugFox committed Oct 16, 2024
1 parent cb427da commit 5ad47df
Show file tree
Hide file tree
Showing 2 changed files with 214 additions and 37 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Deploy

on:
workflow_dispatch:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+*"

jobs:
deploy:
name: "Deploy to Pub.dev"
permissions:
id-token: write # Required for authentication using OIDC
uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1
237 changes: 200 additions & 37 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,70 +2,233 @@
"version": "2.0.0",
"tasks": [
{
"label": "Dependencies",
"label": "flutter:pub:get",
"detail": "Get dependencies for the project",
"icon": {
"color": "terminal.ansiGreen",
"id": "cloud-download"
},
"dependsOn": [],
"type": "shell",
"command": [
"flutter pub get"
],
"args": [],
"group": {
"kind": "none",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"presentation": {
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false,
"group": "dart"
}
},
{
"label": "dart:build_runner:all",
"detail": "Generate code for the project",
"icon": {
"color": "terminal.ansiGreen",
"id": "code"
},
"type": "shell",
"command": [
"dart run build_runner build --delete-conflicting-outputs",
"&& dart format --fix -l 80 lib test"
],
"dependsOn": [
"flutter:pub:get"
],
"args": [],
"group": {
"kind": "none",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"presentation": {
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false,
"group": "dart"
}
},
{
"label": "dart:build_runner:dir",
"detail": "Generate code for the directory",
"type": "shell",
"icon": {
"color": "terminal.ansiGreen",
"id": "code"
},
"command": [
"dart run build_runner build --build-filter '${fileDirname}/*.dart'",
"&& dart format --fix -l 80 '${fileDirname}'"
],
"group": {
"kind": "none",
"isDefault": true
},
"problemMatcher": [],
"dependsOn": [
"flutter:pub:get"
],
"isBackground": false,
"presentation": {
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false,
"group": "dart"
}
},
{
"label": "dart:build_runner:watch",
"detail": "Watch for changes in the project",
"type": "shell",
"icon": {
"color": "terminal.ansiGreen",
"id": "code"
},
"command": [
"(flutter pub get)",
"&& (flutter pub get --directory=example)"
"dart run build_runner watch --build-filter \"${input:directory}/**/*.dart\""
],
"group": {
"kind": "none",
"isDefault": true
},
"problemMatcher": []
"problemMatcher": [],
"dependsOn": [
"flutter:pub:get"
],
"isBackground": false,
"presentation": {
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false,
"group": "dart"
}
},
{
"label": "Format",
"label": "dart:format",
"detail": "Format all files in the project",
"icon": {
"color": "terminal.ansiGreen",
"id": "lightbulb-autofix"
},
"type": "shell",
"command": [
"dart format --fix -l 80"
"dart format --fix -l 80 lib test"
],
"dependsOn": [],
"args": [],
"group": {
"kind": "none",
"isDefault": true
},
"problemMatcher": []
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"presentation": {
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false,
"group": "dart"
}
},
{
"label": "Clear example build",
"label": "flutter:test:all",
"detail": "Run all tests",
"icon": {
"color": "terminal.ansiGreen",
"id": "bug",
},
"dependsOn": [
"flutter:pub:get"
],
"type": "shell",
"command": "make clear-client",
"windows": {
"command": "powershell.exe",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-Command",
"Remove-Item -Path '${workspaceFolder}\\example\\build' -Recurse -Force -ErrorAction Ignore"
]
/* "options": {
"shell": {
"executable": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
}
} */
},
"linux": {
"command": "rm -rf",
"args": [
"${workspaceFolder}/example/build"
]
},
"osx": {
"command": "rm -rf",
"args": [
"${workspaceFolder}/example/build"
]
"command": [
"flutter test --color --coverage --concurrency=50 --platform=tester --reporter=expanded --timeout=30s test/unit_test.dart test/widget_test.dart"
],
"args": [],
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"presentation": {
"reveal": "always",
"panel": "shared"
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false,
"group": "dart"
}
},
{
"label": "flutter:test:feature",
"detail": "Run tests for a specific feature",
"icon": {
"color": "terminal.ansiGreen",
"id": "bug",
},
"dependsOn": [
"flutter:pub:get"
],
"type": "shell",
"command": [
"flutter test --color --coverage --concurrency=50 --platform=tester --reporter=expanded --timeout=30s --tags=\"${input:featureName}\" test/unit_test.dart test/widget_test.dart"
],
"args": [],
"group": {
"kind": "build",
"kind": "test",
"isDefault": true
},
"problemMatcher": [],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"presentation": {
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false,
"group": "dart"
}
}
],
"inputs": [
{
"id": "featureName",
"type": "promptString",
"description": "Enter the feature name (e.g., 'my_feature_name'):",
/* "default": "my_feature_name" */
}
]
}

0 comments on commit 5ad47df

Please sign in to comment.