From 9d5ed2731e6a6db61611c6036cf2a6960520a8f7 Mon Sep 17 00:00:00 2001 From: Calvin Wilkinson Date: Wed, 15 May 2024 12:34:52 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80Preview=20Release=20(v1.0.0-preview?= =?UTF-8?q?.10)=20(#60)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * start work for preview release * release: updated version to v1.0.0-preview.10 * release: create release notes for version v1.0.0-preview.10 * cleanup: remove code from playground script * docs: improve pr release templates * release: improve release notes for version v1.0.0-preview.10 * ci: fix issue in release workflow job --- .github/cicd/playground.ts | 7 -- .../prev-pr-release-template.md | 4 +- .../prod-pr-release-template.md | 4 +- .github/workflows/release.yml | 14 +--- .../Release-Notes-v1.0.0-preview.10.md | 84 +++++++++++++++++++ deno.json | 2 +- 6 files changed, 93 insertions(+), 22 deletions(-) create mode 100644 ReleaseNotes/PreviewReleases/Release-Notes-v1.0.0-preview.10.md diff --git a/.github/cicd/playground.ts b/.github/cicd/playground.ts index a813a48..8d7a470 100644 --- a/.github/cicd/playground.ts +++ b/.github/cicd/playground.ts @@ -1,13 +1,6 @@ -import { IssueOrPRState } from "../../core/Enums.ts"; -import { IssueModel } from "../../deps.ts"; -import { GitClient, IssueClient, LabelClient, MilestoneClient, OrgClient, TagClient } from "../../mod.ts"; - const _token = Deno.args[0]; // NOTE: This is coming from the launch.config json file as an environment variable const _rootRepoDirPath = Deno.args[1]; -const client = new TagClient("KinsonDigital", "Velaptor", "_token"); - -const issues = await client.getAllTags(); debugger; diff --git a/.github/release-templates/prev-pr-release-template.md b/.github/release-templates/prev-pr-release-template.md index 6005533..3c4b431 100644 --- a/.github/release-templates/prev-pr-release-template.md +++ b/.github/release-templates/prev-pr-release-template.md @@ -5,8 +5,8 @@ - [ ] All of the issues in the assigned milestone are closed. - [ ] All issue tasks are checked/marked as complete. - [ ] The `🚀Preview Release` label has been added to this issue. -- [ ] This issue is assigned to a project. -- [ ] This issue is assigned to a milestone. +- [ ] This pr is assigned to a project. +- [ ] This pr is assigned to a milestone. - [ ] All of the unit tests have been executed locally and have passed. _(Check out the appropriate branch before running tests)_. - [ ] The version has been updated. _(All changes made directly on a 'prev-release' branch)_. - [ ] The release notes have been created. _(All changes made directly on a 'prev-release' branch)_. diff --git a/.github/release-templates/prod-pr-release-template.md b/.github/release-templates/prod-pr-release-template.md index ba00e4c..49817fc 100644 --- a/.github/release-templates/prod-pr-release-template.md +++ b/.github/release-templates/prod-pr-release-template.md @@ -5,8 +5,8 @@ - [ ] All of the issues in the assigned milestone are closed. - [ ] All issue tasks are checked/marked as complete. - [ ] The `🚀Production Release` label has been added to this issue. -- [ ] This issue is assigned to a project. -- [ ] This issue is assigned to a milestone. +- [ ] This pr is assigned to a project. +- [ ] This pr is assigned to a milestone. - [ ] All of the unit tests have been executed locally and have passed. _(Check out the appropriate branch before running tests)_. - [ ] The version has been updated. _(All changes made directly on a 'prod-release' branch)_. - [ ] The release notes have been created. _(All changes made directly on a 'prod-release' branch)_. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 559b454..a00539e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,15 +36,14 @@ jobs: $ownerName = "${{ vars.ORGANIZATION_NAME }}".ToLower().Trim($trimChars); $scriptBaseUrl = "${{ vars.SCRIPT_BASE_URL }}".ToLower().Trim($trimChars); - $infraRepoName = "Infrastructure"; $relativeScriptDirPath = "${{ vars.SCRIPT_RELATIVE_DIR_PATH }}".ToLower().Replace("\", "/"); $relativeScriptDirPath = $relativeScriptDirPath.Trim($trimChars).Trim("/"); - $fullBaseScriptUrl = "$scriptBaseUrl/$infraRepoName/$relativeScriptDirPath"; - $cicdScriptsVersion = "${{ vars.CICD_SCRIPTS_VERSION }}".ToLower().Trim($trimChars); + $fullBaseScriptUrl = "$scriptBaseUrl/$cicdScriptsVersion/$relativeScriptDirPath"; + if ($ownerName -eq "") { Write-Host "::error::The 'OWNER_NAME' organization variable is not set."; exit 1; @@ -62,11 +61,6 @@ jobs: exit 1; } - if ($infraRepoName -eq "") { - Write-Host "::error::The 'INFRASTRUCTURE_REPO_NAME' organization variable is not set."; - exit 1; - } - if ($cicdScriptsVersion -eq "") { Write-Host "::error::The 'CICD_SCRIPTS_VERSION' repository variable is not set."; exit 1; @@ -75,7 +69,7 @@ jobs: $versionRegex = "^v([1-9]\d*|0)\.([1-9]\d*|0)\.([1-9]\d*|0)(-preview\.([1-9]\d*))?$"; # Validate that the script version is a valid prod or preview version that follows semantic versioning - if ($cicdScriptsVersion -match $versionRegex) { + if ($cicdScriptsVersion -notmatch $versionRegex) { $errorMsg = "::error::The 'CICD_SCRIPTS_VERSION' repository variable is not a valid preview or production version."; $errorMsg += "`n`tThe version must match the following regex: $versionRegex"; Write-Host $errorMsg; @@ -224,7 +218,7 @@ jobs: - name: Send X Announcement run: | $baseScriptUrl = "${{ needs.construct_infrastructure_url.outputs.url }}"; - $scriptUrl = "$scriptUrl/send-release-tweet.ts"; + $scriptUrl = "$baseScriptUrl/send-release-tweet.ts"; <# Deno Args: 1. Repo owner diff --git a/ReleaseNotes/PreviewReleases/Release-Notes-v1.0.0-preview.10.md b/ReleaseNotes/PreviewReleases/Release-Notes-v1.0.0-preview.10.md new file mode 100644 index 0000000..a71b5c4 --- /dev/null +++ b/ReleaseNotes/PreviewReleases/Release-Notes-v1.0.0-preview.10.md @@ -0,0 +1,84 @@ +

+kd_clients Preview Release Notes - v1.0.0-preview.10 +

+ +

Quick Reminder

+ +
+ +As with all software, there is always a chance for issues and bugs, especially for preview releases, so your input is greatly appreciated. 🙏🏼 +
+ +

New Features ✨

+ +1. [#9](https://github.com/KinsonDigital/kd_clients/issues/9) - Added an error type named `AuthError`. +2. [#53](https://github.com/KinsonDigital/kd_clients/issues/53) - Added a new data model named `AssetModel` to represent a release asset. +3. [#53](https://github.com/KinsonDigital/kd_clients/issues/53) - Added a new property named `assets` to the `ReleaseModel`.type. + +4. [#53](https://github.com/KinsonDigital/kd_clients/issues/53) - Added the following functionality to the `ReleaseClient`: + - A new function named `getReleaseById` was added to get a release using a release ID. + - A new function named `getReleaseByTag` was added to get a release using a release tag. + - A new function named `getAllAssetsByTag` was added to get all release assets using a release tag name. + - A new function named `getAsset` was added to get a single asset from a release using a combination of the release ID or tag and the asset ID or tag. + - A new function named `getReleaseByName` was added to return a release that matches a release name. + - A new function named `uploadAssetsByReleaseName` was added to upload assets to a release that matches a release name. + - A new function named `uploadAssetsByReleaseTag` was added to upload assets to a release that matches a release tag. + - A new function named `downloadAssetById` was added to download a single asset using an asset ID. + - A new function named `downloadAllAssetsByReleaseName` was added to download all release assets using a release name. + - A new function named `downloadAllAssetsByReleaseTag` was added to download all release assets using a release tag. + - A new function named `getLatestRelease` was added to get the latest release. + +

Enhancements ✨

+ +1. [#9](https://github.com/KinsonDigital/kd_clients/issues/9) - Updated all clients to check for authentication issues. + - These will now throw an `AuthError` if authentication has failed. + +

Breaking Changes 🧨

+ +1. [#9](https://github.com/KinsonDigital/kd_clients/issues/9) - Introduced the following breaking changes: + - Changed the name of the 'toReleaseBy' parameter to `tagOrTitle` for the `uploadAssets()` function in the `ReleaseClient` class. + - Moved the `XError` type from the `GitHubClients.Errors.mod.ts` file to the `OtherClients.Errors.mod.ts` file. + - Moved the `NuGetError` type from the `GitHubClients.Errors.mod.ts` file to the `PackageClients.Errors.mod.ts` file. + - Refactored the `getPullRequests()` function return type from `Promise<[PullRequestModel[], Response]>` to `Promise` in the `PullRequestClient` class. + - Refactored the `getIssues()` function return type from `Promise<[IssueModel[], Response]>` to `Promise` in the `IssueClient` class. + - Refactored the `getOwnerRepos()` function return type from `Promise<[RepoModel[], Response]>` to `Promise` in the `RepoClient` class. + - Changed the name of the `getOwnerRepos()` function to `getAllRepos()`. + - Refactored the `getTags()` function return type from `Promise<[TagModel[], Response]>` to `Promise` in the `TagClient` class. + - Refactored the `getWorkflowRuns()` function return type from `Promise<[WorkflowRunModel[], Response]>` to `Promise` in the `WorkflowClient` class. + +2. [#53](https://github.com/KinsonDigital/kd_clients/issues/53) - Introduced the following breaking changes: + - Removed the `getRelease` function from the `ReleaseClient`. +    - This has been replaced by the new function named `getReleaseByName`. + - Removed the `uploadAssets` function from the `ReleaseClient`. +    - The `uploadAssetsByReleaseName` function has replaced this. + - The GitHub token parameter for the `ReleaseClient` was changed from optional to required. + - Removed the `ReleaseOptions` interface. + +

Dependency Updates 📦

+ +1. [#58](https://github.com/KinsonDigital/kd_clients/pull/58) - Updated the following deno standard modules: + - Updated _**exists**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**extname**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**existsSync**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**walkSync**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**ensureDirSync**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**basename**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**isAbsolute**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**decodeBase64**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**encodeBase64**_ from _**0.203.0**_ to _**0.224.0**_ + - Updated _**assert**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**assertEquals**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**assertThrows**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**assertRejects**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**equal**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**assertSpyCall**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**assertSpyCalls**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**spy**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**stub**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**returnsNext**_ form _**0.204.0**_ to _**0.224.0**_ + - Updated _**returnsArg**_ form _**0.204.0**_ to _**0.224.0**_ + +

Other 🪧

+ +1. [#51](https://github.com/KinsonDigital/kd_clients/issues/51) - Fixed an issue with the release process regarding sending release tweets. +2. [#40](https://github.com/KinsonDigital/kd_clients/issues/40) - Fixed an issue in the release process to properly close milestones. diff --git a/deno.json b/deno.json index b362eef..c5b26e4 100644 --- a/deno.json +++ b/deno.json @@ -1,5 +1,5 @@ { - "version": "v1.0.0-preview.9", + "version": "v1.0.0-preview.10", "tasks": { "check": "powershell cls && deno run -A ./.github/cicd/scripts/deno-check.ts", "test": "powershell cls && deno test -A ./tests/*Tests.ts",