Skip to content

Commit

Permalink
Docs (samples): Add vscode build tasks sample files
Browse files Browse the repository at this point in the history
  • Loading branch information
joeltimothyoh committed Jul 22, 2024
1 parent b67e8cd commit be5e5cc
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ The project provides a set of [entrypoint scripts](src/scripts/ci) for generatin

The entrypoint script [`Invoke-Generate.ps1`](src/scripts/ci/Invoke-Generate.ps1) is used to generate release notes for any local git repository. To do so, simply define applicable [environment variables](#environment-variables-1) before executing the entrypoint script.

The project includes [`.vscode/tasks.json`](.vscode/tasks.json) which allows execution of `Invoke-Generate.ps1` via [*Build Tasks*](https://code.visualstudio.com/docs/editor/tasks) in [VSCode](https://code.visualstudio.com/). Simply execute the relevant build task while entering custom or default values per variable prompt.
The project includes [inbuilt](.vscode/tasks.json) and [samples](docs/samples/.vscode) of `.vscode/tasks.json` for generating release notes via [*Build Tasks*](https://code.visualstudio.com/docs/editor/tasks) in [VSCode](https://code.visualstudio.com/). Simply execute the relevant build task while entering custom or default values per variable prompt.

##### Variants

Expand All @@ -107,7 +107,7 @@ Generating of release notes supports all tag refs. Tags *need not* follow [Seman

The entrypoint script [`Invoke-Release.ps1`](src/scripts/ci/Invoke-Release.ps1) can be used to create releases for GitHub repositories. To do so, simply define applicable [environment variables](#environment-variables-1) before executing the entrypoint script.

The project includes [`.vscode/tasks.json`](.vscode/tasks.json) which allows execution of `Invoke-Release.ps1` via [*Build Tasks*](https://code.visualstudio.com/docs/editor/tasks) in [VSCode](https://code.visualstudio.com/). Simply execute the relevant build task while entering custom or default values per variable prompt. Note that due to the inability to enter multiline strings in build tasks, the options `RELEASE_NOTES_CONTENT` and `RELEASE_ASSETS` are presently unavailable and limited in usability respectively.
The project includes [inbuilt](.vscode/tasks.json) and [samples](docs/samples/.vscode) of `.vscode/tasks.json` for creating releases via [*Build Tasks*](https://code.visualstudio.com/docs/editor/tasks) in [VSCode](https://code.visualstudio.com/). Simply execute the relevant build task while entering custom or default values per variable prompt. Note that due to the inability to enter multiline strings in build tasks, the options `RELEASE_NOTES_CONTENT` and `RELEASE_ASSETS` are presently unavailable and limited in usability respectively.

##### Valid tags

Expand Down
139 changes: 139 additions & 0 deletions docs/samples/.vscode/tasks.submodule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"inputs": [
// PSRepositoryReleaseManager
{
"id": "PROJECT_DIRECTORY",
"description": "PROJECT_DIRECTORY?",
"type": "promptString",
"default": "${workspaceFolder}"
},
{
"id": "RELEASE_TAG_REF",
"description": "RELEASE_TAG_REF?",
"type": "promptString",
"default": "vx.x.x | branch | HEAD | remote/branch | commit-hash"
},
{
"id": "RELEASE_NOTES_VARIANT",
"description": "RELEASE_NOTES_VARIANT?",
"type": "pickString",
"options": [
"Changes-HashSubject-Merges",
"Changes-HashSubject-NoMerges-Categorized",
"Changes-HashSubject-NoMerges-CategorizedSorted",
"Changes-HashSubject-NoMerges",
"Changes-HashSubject",
"Changes-HashSubjectAuthor-NoMerges-Categorized",
"Changes-HashSubjectAuthor-NoMerges-CategorizedSorted",
"VersionDate-HashSubject-Merges",
"VersionDate-HashSubject-NoMerges-Categorized",
"VersionDate-HashSubject-NoMerges-CategorizedSorted",
"VersionDate-HashSubject-NoMerges",
"VersionDate-HashSubject",
"VersionDate-HashSubjectAuthor-NoMerges-Categorized",
"VersionDate-HashSubjectAuthor-NoMerges-CategorizedSorted",
"VersionDate-Subject-Merges",
"VersionDate-Subject-NoMerges-Categorized",
"VersionDate-Subject-NoMerges-CategorizedSorted",
"VersionDate-Subject-NoMerges",
"VersionDate-Subject",
"VersionDate-SubjectAuthor-NoMerges-Categorized",
"VersionDate-SubjectAuthor-NoMerges-CategorizedSorted"
],
"default": "VersionDate-HashSubject-NoMerges-CategorizedSorted"
},
{
"id": "RELEASE_NOTES_PATH",
"description": "RELEASE_NOTES_PATH?",
"type": "promptString",
"default": "${workspaceFolder}/.release-notes.md"
},
{
"id": "GITHUB_API_TOKEN",
"description": "GITHUB_API_TOKEN?",
"type": "promptString",
"default": "xxx",
"password": true
},
{
"id": "RELEASE_NAMESPACE",
"description": "RELEASE_NAMESPACE?",
"type": "promptString",
"default": "mygithubnamespace"
},
{
"id": "RELEASE_REPOSITORY",
"description": "RELEASE_REPOSITORY?",
"type": "promptString",
"default": "my-project"
},
{
"id": "RELEASE_NAME",
"description": "RELEASE_NAME?",
"type": "promptString",
"default": "My release name | vx.x.x"
},
// {
// "id": "RELEASE_NOTES_CONTENT",
// "description": "RELEASE_NOTES_CONTENT?",
// "type": "promptString",
// "default": "My multi-line release notes",
// },
{
"id": "RELEASE_DRAFT",
"description": "RELEASE_DRAFT?",
"type": "pickString",
"options": [
"true",
"false"
],
"default": "false"
},
{
"id": "RELEASE_PRERELEASE",
"description": "RELEASE_PRERELEASE?",
"type": "pickString",
"options": [
"true",
"false"
],
"default": "false"
},
{
"id": "RELEASE_ASSETS",
"description": "RELEASE_ASSETS?",
"type": "promptString",
"default": "path/to/assets/*"
}
],
"tasks": [
// PSRepositoryReleaseManager
{
"label": "[PSRepositoryReleaseManager] Generate release notes (pwsh)",
"type": "shell",
"command": "PROJECT_DIRECTORY='${input:PROJECT_DIRECTORY}' RELEASE_TAG_REF='${input:RELEASE_TAG_REF}' RELEASE_NOTES_VARIANT='${input:RELEASE_NOTES_VARIANT}' RELEASE_NOTES_PATH='${input:RELEASE_NOTES_PATH}' pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = \"Continue\"; ./build/PSRepositoryReleaseManager/src/scripts/ci/Invoke-Generate.ps1'",
"group": "build"
},
{
"label": "[PSRepositoryReleaseManager] Generate release notes (powershell)",
"type": "shell",
"command": "PROJECT_DIRECTORY='${input:PROJECT_DIRECTORY}' RELEASE_TAG_REF='${input:RELEASE_TAG_REF}' RELEASE_NOTES_VARIANT='${input:RELEASE_NOTES_VARIANT}' RELEASE_NOTES_PATH='${input:RELEASE_NOTES_PATH}' powershell -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = \"Continue\"; ./build/PSRepositoryReleaseManager/src/scripts/ci/Invoke-Generate.ps1'",
"group": "build"
},
{
"label": "[PSRepositoryReleaseManager] Create release (pwsh)",
"type": "shell",
"command": "GITHUB_API_TOKEN='${input:GITHUB_API_TOKEN}' PROJECT_DIRECTORY='${input:PROJECT_DIRECTORY}' RELEASE_TAG_REF='${input:RELEASE_TAG_REF}' RELEASE_NAMESPACE='${input:RELEASE_NAMESPACE}' RELEASE_REPOSITORY='${input:RELEASE_REPOSITORY}' RELEASE_NAME='${input:RELEASE_NAME}' RELEASE_DRAFT='${input:RELEASE_DRAFT}' RELEASE_PRERELEASE='${input:RELEASE_PRERELEASE}' RELEASE_ASSETS='${input:RELEASE_ASSETS}' pwsh -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = \"Continue\"; ./build/PSRepositoryReleaseManager/src/scripts/ci/Invoke-Release.ps1'",
"group": "build"
},
{
"label": "[PSRepositoryReleaseManager] Create release (powershell)",
"type": "shell",
"command": "GITHUB_API_TOKEN='${input:GITHUB_API_TOKEN}' PROJECT_DIRECTORY='${input:PROJECT_DIRECTORY}' RELEASE_TAG_REF='${input:RELEASE_TAG_REF}' RELEASE_NAMESPACE='${input:RELEASE_NAMESPACE}' RELEASE_REPOSITORY='${input:RELEASE_REPOSITORY}' RELEASE_NAME='${input:RELEASE_NAME}' RELEASE_DRAFT='${input:RELEASE_DRAFT}' RELEASE_PRERELEASE='${input:RELEASE_PRERELEASE}' RELEASE_ASSETS='${input:RELEASE_ASSETS}' powershell -NoLogo -NonInteractive -NoProfile -Command '$VerbosePreference = \"Continue\"; ./build/PSRepositoryReleaseManager/src/scripts/ci/Invoke-Release.ps1'",
"group": "build"
}
]
}

0 comments on commit be5e5cc

Please sign in to comment.