From 5abb3c52c84bc28dddfc88aafdf190abbb5215fe Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Fri, 11 Nov 2022 11:57:53 -0500 Subject: [PATCH 1/2] v0.2.1-publish-test.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 18c2a38..8a3cd3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@nathanstilwell/time", - "version": "0.1.2", + "version": "0.2.1-publish-test.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@nathanstilwell/time", - "version": "0.1.2", + "version": "0.2.1-publish-test.0", "license": "Unlicense", "devDependencies": { "@cockroachlabs/eslint-config": "^1.0.1", diff --git a/package.json b/package.json index 07030ce..2982402 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nathanstilwell/time", - "version": "0.2.0", + "version": "0.2.1-publish-test.0", "description": "Utility for basic time calculations", "main": "dist/index.js", "files": [ From b55415dc90d3ee6d48aa57343b90d5aae527991a Mon Sep 17 00:00:00 2001 From: Nathan Stilwell Date: Fri, 11 Nov 2022 12:04:25 -0500 Subject: [PATCH 2/2] tweaking publishing workflow --- .github/workflows/auto-publish.yml | 20 ++++++++++++++------ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml index e675099..8cd14ac 100644 --- a/.github/workflows/auto-publish.yml +++ b/.github/workflows/auto-publish.yml @@ -25,18 +25,26 @@ jobs: - name: Check if version is published id: version-check shell: bash + continue-on-error: true run: | - npm info @nathanstilwell/time@$(node -pe "require('./package.json').version") > /dev/null 2>&1; - echo "version_not_exists=$?" >> $GITHUB_OUTPUT + PACKAGE_VERSION=$(cat ./package.json | jq -r ".version"); + VERSIONS=$(npm view @nathanstilwell/time versions) + if [[ $VERSIONS == *"$PACKAGE_VERSION"* ]]; then + echo "published=yes" >> $GITHUB_OUTPUT + echo + echo "🛑 Cluster UI package version $PACKAGE_VERSION is already published" + echo "to npm. Publishing step should be skipped. 🛑" + else + echo "published=no" >> $GITHUB_OUTPUT + fi - name: Build - if: steps.version_check.output.version_not_exists run: | - npm install - npm run Build + npm install; + npm run build; - name: Publish - if: steps.version_check.output.version_not_exists + if: steps.version-check.outputs.published == 'no' run: | npm publish --access public --tag testing --dry-run diff --git a/package-lock.json b/package-lock.json index 8a3cd3f..246d922 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@nathanstilwell/time", - "version": "0.2.1-publish-test.0", + "version": "0.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@nathanstilwell/time", - "version": "0.2.1-publish-test.0", + "version": "0.2.0", "license": "Unlicense", "devDependencies": { "@cockroachlabs/eslint-config": "^1.0.1", diff --git a/package.json b/package.json index 2982402..07030ce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nathanstilwell/time", - "version": "0.2.1-publish-test.0", + "version": "0.2.0", "description": "Utility for basic time calculations", "main": "dist/index.js", "files": [