From 005ad5794f55621bbede4d1d68ead10def14a3d5 Mon Sep 17 00:00:00 2001 From: Crystal Liang Date: Wed, 23 Oct 2024 11:46:30 -0700 Subject: [PATCH] chore: draft release workflow --- .github/workflows/release_draft.yml | 57 +++++++++++++++++++++++++++++ CHANGELOG.md | 9 +++++ mysql/lib/client.ts | 2 +- 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release_draft.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release_draft.yml b/.github/workflows/release_draft.yml new file mode 100644 index 00000000..ae945153 --- /dev/null +++ b/.github/workflows/release_draft.yml @@ -0,0 +1,57 @@ +name: "Release Draft" + +on: + push: + tags: + - "[0-9]+.[0-9]+.[0-9]+" + branches: + - release-draft-workflow + +permissions: + actions: write + contents: write + deployments: write + packages: write + pull-requests: write + repository-projects: write + +jobs: + ubuntu-latest-nodejs-wrapper-release-gh-draft: + name: "Build And Release Draft" + runs-on: ubuntu-latest + steps: + - name: "Clone Repository" + uses: actions/checkout@v4 + with: + fetch-depth: 50 + - name: "Set up Node.js" + uses: actions/setup-node@v3 + with: + node-version: "20.x" + - name: "Install dependencies" + run: npm install --no-save + - name: "Run eslint - linting" + run: npm run lint + - name: "Check formatting" + run: npm run check + - name: "Run unit tests" + run: npm test + - name: "Package Wrapper" + run: npm pack --pack-destination ./build + - name: "Set Version Env Variable" + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: "Get Release Details" + run: | + export RELEASE_DETAILS="$(awk -vN=2 'n RELEASE_DETAILS.md + - name: "Upload to Draft Release" + uses: ncipollo/release-action@v1 + with: + draft: true + name: "AWS Advanced NodeJS Wrapper - v${{ env.RELEASE_VERSION }}" + bodyFile: RELEASE_DETAILS.md + artifacts: ./build/* + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..65ada656 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/#semantic-versioning-200). + +## [0.0.1] + +[0.0.1]: https://github.com/awslabs/aws-advanced-nodejs-wrapper/releases/tag/0.0.1 diff --git a/mysql/lib/client.ts b/mysql/lib/client.ts index ac2a060a..b121386b 100644 --- a/mysql/lib/client.ts +++ b/mysql/lib/client.ts @@ -216,7 +216,7 @@ export class AwsMySQLClient extends AwsClient { // This might happen if end is called in a finally block when an error occurred while initializing the first connection. return; } - + const hostInfo: HostInfo | null = this.pluginService.getCurrentHostInfo(); const result = await this.pluginManager.execute( this.pluginService.getCurrentHostInfo(),