Skip to content

Commit f974ec5

Browse files
committed
chore: update publish action script
1 parent 63508f9 commit f974ec5

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

.github/workflows/npm-publish.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
statuses: write
1212

1313
jobs:
14-
check-release-tag-core:
14+
check-core-release-tag:
1515
runs-on: ubuntu-latest
1616
outputs:
1717
is_semver_tag: ${{ steps.check-core-release.outputs.is_semver_tag }}
@@ -25,7 +25,7 @@ jobs:
2525
echo "is_semver_tag=false" >> "$GITHUB_OUTPUT"
2626
fi
2727
28-
check-release-tag-plugin:
28+
check-plugin-release-tag:
2929
runs-on: ubuntu-latest
3030
outputs:
3131
is_plugin_tag: ${{ steps.check-plugin-release.outputs.is_plugin_tag }}
@@ -41,16 +41,16 @@ jobs:
4141
echo "is_plugin_tag=false" >> "$GITHUB_OUTPUT"
4242
fi
4343
44-
run-unit-tests-core:
45-
if: needs.check-release-tag-core.outputs.is_semver_tag == 'true'
46-
needs: check-release-tag-core
44+
run-core-unit-tests:
45+
if: needs.check-core-release-tag.outputs.is_semver_tag == 'true'
46+
needs: check-core-release-tag
4747
uses: ./.github/workflows/reusable-test.yml
4848
with:
4949
use-matrix: true
5050

51-
run-unit-tests-plugin:
52-
if: needs.check-release-tag-plugin.outputs.is_plugin_tag == 'true'
53-
needs: check-release-tag-plugin
51+
run-plugin-unit-tests:
52+
if: needs.check-plugin-release-tag.outputs.is_plugin_tag == 'true'
53+
needs: check-plugin-release-tag
5454
runs-on: ubuntu-latest
5555
steps:
5656
- uses: actions/checkout@v4
@@ -81,12 +81,12 @@ jobs:
8181
run: npm run build
8282

8383
- name: Run modern jest tests (target plugin)
84-
working-directory: packages/${{ needs.check-release-tag-plugin.outputs.plugin_name }}
84+
working-directory: packages/${{ needs.check-plugin-release-tag.outputs.plugin_name }}
8585
run: npm test
8686

8787
publish-npm-core:
88-
if: needs.check-release-tag-core.outputs.is_semver_tag == 'true'
89-
needs: [check-release-tag-core, run-unit-tests-core]
88+
if: needs.check-core-release-tag.outputs.is_semver_tag == 'true'
89+
needs: [check-core-release-tag, run-core-unit-tests]
9090
runs-on: ubuntu-latest
9191
steps:
9292
- uses: actions/checkout@v4
@@ -255,8 +255,8 @@ jobs:
255255
fi
256256
257257
publish-npm-plugin:
258-
if: needs.check-release-tag-plugin.outputs.is_plugin_tag == 'true'
259-
needs: [check-release-tag-plugin, run-unit-tests-plugin]
258+
if: needs.check-plugin-release-tag.outputs.is_plugin_tag == 'true'
259+
needs: [check-plugin-release-tag, run-plugin-unit-tests]
260260
runs-on: ubuntu-latest
261261
steps:
262262
- uses: actions/checkout@v4
@@ -284,35 +284,35 @@ jobs:
284284
run: npm run build
285285

286286
- name: Build the plugin package
287-
working-directory: packages/${{ needs.check-release-tag-plugin.outputs.plugin_name }}
287+
working-directory: packages/${{ needs.check-plugin-release-tag.outputs.plugin_name }}
288288
run: npm run build
289289

290290
- name: Run the plugin tests
291-
working-directory: packages/${{ needs.check-release-tag-plugin.outputs.plugin_name }}
291+
working-directory: packages/${{ needs.check-plugin-release-tag.outputs.plugin_name }}
292292
run: npm test
293293

294-
- name: Request the latest version of @enum-plus/${{ needs.check-release-tag-plugin.outputs.plugin_name }} before publish
294+
- name: Request the latest version of @enum-plus/${{ needs.check-plugin-release-tag.outputs.plugin_name }} before publish
295295
id: get_latest_version_before_publish
296296
run: |
297-
VERSION=$(npm view @enum-plus/${{ needs.check-release-tag-plugin.outputs.plugin_name }} version || echo 0.0.0)
297+
VERSION=$(npm view @enum-plus/${{ needs.check-plugin-release-tag.outputs.plugin_name }} version || echo 0.0.0)
298298
echo "LATEST_VERSION=$VERSION" >> $GITHUB_OUTPUT
299299
300-
- name: Request the next version of @enum-plus/${{ needs.check-release-tag-plugin.outputs.plugin_name }} before publish
300+
- name: Request the next version of @enum-plus/${{ needs.check-plugin-release-tag.outputs.plugin_name }} before publish
301301
id: get_next_version_before_publish
302302
continue-on-error: true
303303
run: |
304-
VERSION=$(npm view @enum-plus/${{ needs.check-release-tag-plugin.outputs.plugin_name }}@next version 2>/dev/null || echo 0.0.0)
304+
VERSION=$(npm view @enum-plus/${{ needs.check-plugin-release-tag.outputs.plugin_name }}@next version 2>/dev/null || echo 0.0.0)
305305
echo "NEXT_VERSION=$VERSION" >> $GITHUB_OUTPUT
306306
307307
- name: Publish a prerelease version to npm
308-
working-directory: packages/${{ needs.check-release-tag-plugin.outputs.plugin_name }}
308+
working-directory: packages/${{ needs.check-plugin-release-tag.outputs.plugin_name }}
309309
run: npm publish --tag beta --ignore-scripts --access=public
310310
if: github.event.release.prerelease
311311
env:
312312
NODE_AUTH_TOKEN: ${{ secrets.AT_ENUM_PLUS_SCOPE_NPM_TOKEN }}
313313

314314
- name: Publish a regular version to npm
315-
working-directory: packages/${{ needs.check-release-tag-plugin.outputs.plugin_name }}
315+
working-directory: packages/${{ needs.check-plugin-release-tag.outputs.plugin_name }}
316316
run: npm publish --ignore-scripts --access=public
317317
if: github.event.release.prerelease == false
318318
env:
@@ -334,7 +334,7 @@ jobs:
334334
if: github.event.release.prerelease
335335
run: |
336336
if [ "${{ steps.new_vs_latest.outputs.comparison-result }}" = ">" ]; then
337-
npm dist-tag add @enum-plus/${{ needs.check-release-tag-plugin.outputs.plugin_name }}@${{ github.event.release.tag_name }} next --access=public
337+
npm dist-tag add @enum-plus/${{ needs.check-plugin-release-tag.outputs.plugin_name }}@${{ github.event.release.tag_name }} next --access=public
338338
fi
339339
env:
340340
NODE_AUTH_TOKEN: ${{ secrets.AT_ENUM_PLUS_SCOPE_NPM_TOKEN }}
@@ -343,7 +343,7 @@ jobs:
343343
if: github.event.release.prerelease == false
344344
run: |
345345
if [ "${{ steps.get_next_version_before_publish.outputs.NEXT_VERSION }}" != "0.0.0" ] && [ "${{ steps.new_vs_next.outputs.comparison-result }}" = ">" ]; then
346-
npm dist-tag rm @enum-plus/${{ needs.check-release-tag-plugin.outputs.plugin_name }} next --access=public
346+
npm dist-tag rm @enum-plus/${{ needs.check-plugin-release-tag.outputs.plugin_name }} next --access=public
347347
fi
348348
env:
349349
NODE_AUTH_TOKEN: ${{ secrets.AT_ENUM_PLUS_SCOPE_NPM_TOKEN }}
@@ -353,8 +353,8 @@ jobs:
353353
with:
354354
token: ${{ secrets.CODECOV_TOKEN }}
355355
slug: shijistar/enum-plus
356-
files: packages/${{ needs.check-release-tag-plugin.outputs.plugin_name }}/coverage/lcov.info
356+
files: packages/${{ needs.check-plugin-release-tag.outputs.plugin_name }}/coverage/lcov.info
357357
# Give the current upload a unique identifier for easy grouping in the Codecov UI
358-
flags: plugin-${{ needs.check-release-tag-plugin.outputs.plugin_name }}
358+
flags: plugin-${{ needs.check-plugin-release-tag.outputs.plugin_name }}
359359
# Optional: Give this upload a name
360-
name: ${{ needs.check-release-tag-plugin.outputs.plugin_name }}
360+
name: ${{ needs.check-plugin-release-tag.outputs.plugin_name }}

0 commit comments

Comments
 (0)