From c26034401d548ac64bb3785b31d63285aae20ee5 Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Wed, 2 Oct 2024 15:05:55 -0400 Subject: [PATCH 1/3] chore(release): v0.2.1-alpha.13 --- .github/workflows/release.yml | 28 ++++++++-------------------- package.json | 2 +- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9f762b..93ce198 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,25 +11,13 @@ jobs: name: Release runs-on: ubuntu-22.04 - # Fetching tags: https://stackoverflow.com/a/76181083 steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 10 - fetch-tags: true - - # Step output: https://stackoverflow.com/a/65616499 - # Reading latest tag: https://stackoverflow.com/a/33733020 - - name: Read git tag - id: git-tag - run: echo "TAG_NAME=$(git tag --points-at HEAD)" >> $GITHUB_OUTPUT - - name: Verify git tag - env: - GIT_TAG: ${{ steps.git-tag.outputs.TAG_NAME }} - if: startsWith(env.GIT_TAG, 'v') == false - run: echo "Missing or invalid git tag; aborting" && exit 1 + - name: Read package version + id: version + run: echo "PKG_VERSION=v$(npm pkg get version | xargs)" >> $GITHUB_OUTPUT - name: Set up Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v4 @@ -42,14 +30,14 @@ jobs: with: result-encoding: string script: | - const gitTag = '${{ steps.git-tag.outputs.TAG_NAME }}' - console.log(`git tag: ${gitTag}`) - if (gitTag.match(/^v\d+\.\d+\.\d+$/)) { + const version = '${{ steps.version.outputs.PKG_VERSION }}' + console.log(`version: ${version}`) + if (version.match(/^v\d+\.\d+\.\d+$/)) { distTag = 'latest' - } else if (gitTag.match(/^v\d+\.\d+\.\d+/)) { + } else if (version.match(/^v\d+\.\d+\.\d+/)) { distTag = 'alpha' } else { - core.setFailed('Tag must follow SemVer convention. Aborting.'); + core.setFailed('Version must follow SemVer convention. Aborting.'); } console.log(`npm dist tag: ${distTag}`) return distTag diff --git a/package.json b/package.json index cefadbf..29c5e51 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "repository": "github:CartoDB/carto-api-client", "author": "Don McCurdy ", "packageManager": "yarn@4.3.1", - "version": "0.2.1-alpha.12", + "version": "0.2.1-alpha.13", "license": "MIT", "publishConfig": { "access": "public", From e3a3df7443df0ff36aece652c2698c9bf04b922d Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Wed, 2 Oct 2024 15:15:16 -0400 Subject: [PATCH 2/3] Remove redundant tests in release.yml --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 93ce198..9d230c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,6 +15,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 + # Read version from 'package.json'; git tags are lost on a merged PR. - name: Read package version id: version run: echo "PKG_VERSION=v$(npm pkg get version | xargs)" >> $GITHUB_OUTPUT @@ -24,6 +25,7 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} + # Determine whether to tag the release as 'latest' or 'alpha'. - name: Assign dist tag id: dist-tag uses: actions/github-script@v7 @@ -47,11 +49,9 @@ jobs: corepack enable yarn install + # Build. Tests are run automatically by `yarn prepublish`. - name: Build - run: | - yarn lint - yarn build - yarn test + run: yarn build - name: Configure yarn to publish packages env: From 6063c3963f7a96f4405f8d3b7af9b9538dc867ee Mon Sep 17 00:00:00 2001 From: Don McCurdy Date: Wed, 2 Oct 2024 15:16:40 -0400 Subject: [PATCH 3/3] chore(release): v0.2.1 --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 29c5e51..bb6033b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "repository": "github:CartoDB/carto-api-client", "author": "Don McCurdy ", "packageManager": "yarn@4.3.1", - "version": "0.2.1-alpha.13", + "version": "0.2.1", "license": "MIT", "publishConfig": { "access": "public", @@ -98,6 +98,5 @@ "@turf/invariant": "^7.1.0", "@turf/union": "^7.1.0", "@types/geojson": "^7946.0.14" - }, - "stableVersion": "0.2.0" + } }