diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 23bb1efb8..72e943291 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -33,19 +33,19 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'npm' - - - name: Use cached node_modules (tailwindcss) - id: cache-tailwindcss - uses: actions/cache@v3 - with: - path: node_modules - key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}-tailwindcss - restore-keys: | - nodeModules- + # cache: 'npm' + # + # - name: Use cached node_modules (tailwindcss) + # id: cache-tailwindcss + # uses: actions/cache@v3 + # with: + # path: node_modules + # key: nodeModules-${{ hashFiles('./package-lock.json') }}-${{ matrix.node-version }}-tailwindcss + # restore-keys: | + # nodeModules- - name: Install dependencies - if: steps.cache-tailwindcss.outputs.cache-hit != 'true' + # if: steps.cache-tailwindcss.outputs.cache-hit != 'true' run: npm install env: CI: true diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 4a5ec2bbc..25b0f037e 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -26,8 +26,8 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - # cache: 'npm' - + # cache: 'npm' + # # - name: Use cached node_modules # id: cache # uses: actions/cache@v3 diff --git a/.github/workflows/release-insiders.yml b/.github/workflows/release-insiders.yml index 1e94bec0f..a55883a22 100644 --- a/.github/workflows/release-insiders.yml +++ b/.github/workflows/release-insiders.yml @@ -23,8 +23,8 @@ jobs: with: node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - # cache: 'npm' - + # cache: 'npm' + # # - name: Use cached node_modules # id: cache # uses: actions/cache@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25d534690..fa52adb78 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,19 +23,19 @@ jobs: with: node-version: ${{ matrix.node-version }} registry-url: 'https://registry.npmjs.org' - cache: 'npm' - - - name: Use cached node_modules - id: cache - uses: actions/cache@v3 - with: - path: node_modules - key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }} - restore-keys: | - nodeModules- + # cache: 'npm' + # + # - name: Use cached node_modules + # id: cache + # uses: actions/cache@v3 + # with: + # path: node_modules + # key: nodeModules-${{ hashFiles('**/package-lock.json') }}-${{ matrix.node-version }} + # restore-keys: | + # nodeModules- - name: Install dependencies - if: steps.cache.outputs.cache-hit != 'true' + # if: steps.cache.outputs.cache-hit != 'true' run: npm install env: CI: true @@ -45,8 +45,12 @@ jobs: env: CI: true + - name: Calculate tag + run: | + echo "tag_name=$(npm run calculate-tag-name --silent)" >> $GITHUB_ENV + - name: Publish - run: npm publish + run: npm publish --tag ${{ env.tag_name }} env: CI: true NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index 887ea0e77..645128fd4 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "posttest": "npm run style", "generate:plugin-list": "node -r @swc/register scripts/create-plugin-list.js", "generate:types": "node -r @swc/register scripts/generate-types.js", - "generate": "npm run generate:plugin-list && npm run generate:types" + "generate": "npm run generate:plugin-list && npm run generate:types", + "calculate-tag-name": "node scripts/calculate-tag-name.js" }, "files": [ "src/*", diff --git a/scripts/calculate-tag-name.js b/scripts/calculate-tag-name.js new file mode 100644 index 000000000..7d9cd7939 --- /dev/null +++ b/scripts/calculate-tag-name.js @@ -0,0 +1,8 @@ +let version = process.env.npm_package_version || require('../package.json').version + +let match = /\d+\.\d+\.\d+-(.*)\.\d+/g.exec(version) +if (match) { + console.log(match[1]) +} else { + console.log('latest') +}