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 18c2a38..246d922 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@nathanstilwell/time", - "version": "0.1.2", + "version": "0.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@nathanstilwell/time", - "version": "0.1.2", + "version": "0.2.0", "license": "Unlicense", "devDependencies": { "@cockroachlabs/eslint-config": "^1.0.1",