@cbnventures/nova 0.15.4 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/build/package.json +1 -1
  2. package/build/src/cli/generate/github/workflows.d.ts +6 -1
  3. package/build/src/cli/generate/github/workflows.d.ts.map +1 -1
  4. package/build/src/cli/generate/github/workflows.js +244 -6
  5. package/build/src/cli/generate/github/workflows.js.map +1 -1
  6. package/build/src/cli/utility/initialize.d.ts.map +1 -1
  7. package/build/src/cli/utility/initialize.js +228 -4
  8. package/build/src/cli/utility/initialize.js.map +1 -1
  9. package/build/src/lib/nova-config.d.ts.map +1 -1
  10. package/build/src/lib/nova-config.js +33 -0
  11. package/build/src/lib/nova-config.js.map +1 -1
  12. package/build/src/lib/regex.d.ts +4 -0
  13. package/build/src/lib/regex.d.ts.map +1 -1
  14. package/build/src/lib/regex.js +4 -0
  15. package/build/src/lib/regex.js.map +1 -1
  16. package/build/src/lib/workflow-templates.d.ts.map +1 -1
  17. package/build/src/lib/workflow-templates.js +176 -113
  18. package/build/src/lib/workflow-templates.js.map +1 -1
  19. package/build/src/types/cli/generate/github/workflows.d.ts +178 -0
  20. package/build/src/types/cli/utility/initialize.d.ts +216 -0
  21. package/build/src/types/lib/nova-config.d.ts +24 -0
  22. package/build/src/types/lib/workflow-templates.d.ts +53 -0
  23. package/build/src/types/shared.d.ts +103 -1
  24. package/build/src/types/tests/cli/generate/github/workflows-helpers.test.d.ts +54 -0
  25. package/build/src/types/tests/cli/generate/github/workflows.test.d.ts +12 -2
  26. package/build/src/types/tests/lib/workflow-templates.test.d.ts +10 -70
  27. package/build/templates/generators/github/workflows/check-sponsor-gated-issues/base.yml +6 -10
  28. package/build/templates/generators/github/workflows/check-sponsor-gated-issues/triggers/issue-comment.yml +5 -0
  29. package/build/templates/generators/github/workflows/check-sponsor-gated-issues/triggers/issues.yml +5 -0
  30. package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/schedule-daily.yml +5 -0
  31. package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/schedule-monthly.yml +5 -0
  32. package/build/templates/generators/github/workflows/{publish-to-cloudflare-pages-docusaurus → publish}/base.yml +8 -17
  33. package/build/templates/generators/github/workflows/publish/targets/aws-amplify-nextjs.yml +32 -0
  34. package/build/templates/generators/github/workflows/publish/targets/cloudflare-pages-docusaurus.yml +25 -0
  35. package/build/templates/generators/github/workflows/publish/targets/docker-hub.yml +47 -0
  36. package/build/templates/generators/github/workflows/publish/targets/ghcr.yml +47 -0
  37. package/build/templates/generators/github/workflows/publish/targets/github-packages.yml +84 -0
  38. package/build/templates/generators/github/workflows/publish/targets/github-pages-docusaurus.yml +43 -0
  39. package/build/templates/generators/github/workflows/publish/targets/npm.yml +60 -0
  40. package/build/templates/generators/github/workflows/publish/targets/vercel-nextjs.yml +45 -0
  41. package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/release.yml +1 -1
  42. package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/workflow-run-any.yml +1 -1
  43. package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/workflow-run-failure.yml +1 -1
  44. package/build/templates/generators/github/workflows/{publish-to-npm → publish}/triggers/workflow-run-success.yml +1 -1
  45. package/package.json +1 -1
  46. package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/base.yml +0 -54
  47. package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/triggers/push.yml +0 -5
  48. package/build/templates/generators/github/workflows/publish-to-aws-amplify-nextjs/triggers/release.yml +0 -5
  49. package/build/templates/generators/github/workflows/publish-to-cloudflare-pages-docusaurus/triggers/push.yml +0 -5
  50. package/build/templates/generators/github/workflows/publish-to-cloudflare-pages-docusaurus/triggers/release.yml +0 -5
  51. package/build/templates/generators/github/workflows/publish-to-docker-hub/base.yml +0 -59
  52. package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/release.yml +0 -5
  53. package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-any.yml +0 -7
  54. package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-failure.yml +0 -8
  55. package/build/templates/generators/github/workflows/publish-to-docker-hub/triggers/workflow-run-success.yml +0 -8
  56. package/build/templates/generators/github/workflows/publish-to-github-packages/base.yml +0 -120
  57. package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/release.yml +0 -5
  58. package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-any.yml +0 -7
  59. package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-failure.yml +0 -8
  60. package/build/templates/generators/github/workflows/publish-to-github-packages/triggers/workflow-run-success.yml +0 -8
  61. package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/base.yml +0 -79
  62. package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/triggers/push.yml +0 -5
  63. package/build/templates/generators/github/workflows/publish-to-github-pages-docusaurus/triggers/release.yml +0 -5
  64. package/build/templates/generators/github/workflows/publish-to-npm/base.yml +0 -97
  65. /package/build/templates/generators/github/workflows/lock-inactive-issues/triggers/{schedule.yml → schedule-weekly.yml} +0 -0
@@ -1,59 +0,0 @@
1
- name: "Publish to Docker Hub[__WORKFLOW_ID__]"
2
-
3
- run-name: "[__RUN_NAME__]"
4
-
5
- on:
6
- [__TRIGGERS__]
7
- workflow_dispatch:
8
- inputs:
9
- dry-run:
10
- description: "Run without making changes"
11
- required: false
12
- type: "boolean"
13
- default: true
14
-
15
- permissions:
16
- contents: "read"
17
-
18
- concurrency:
19
- group: "${{ github.workflow }}-${{ github.ref }}"
20
- cancel-in-progress: false
21
-
22
- env:
23
- DOCKERHUB_USERNAME: "${{ vars.DOCKERHUB_USERNAME }}"
24
- PUBLISH: "[__PUBLISH_CONDITION__]"
25
-
26
- jobs:
27
- publish-to-docker-hub:
28
- runs-on: "ubuntu-latest"
29
- timeout-minutes: 15
30
- [__JOBS_CONDITION__]
31
- steps:
32
- - name: "Checkout repository"
33
- uses: "actions/checkout@v6"
34
-
35
- - name: "Set up QEMU"
36
- uses: "docker/setup-qemu-action@v3"
37
- with:
38
- platforms: "linux/amd64,linux/arm64"
39
-
40
- - name: "Set up Docker Buildx"
41
- uses: "docker/setup-buildx-action@v3"
42
-
43
- - name: "Login to Docker Hub"
44
- uses: "docker/login-action@v3"
45
- env:
46
- DOCKERHUB_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}"
47
- with:
48
- username: "${{ env.DOCKERHUB_USERNAME }}"
49
- password: "${{ env.DOCKERHUB_TOKEN }}"
50
-
51
- - name: "Build and push"
52
- uses: "docker/build-push-action@v6"
53
- with:
54
- context: "."
55
- platforms: "linux/amd64,linux/arm64"
56
- push: "${{ env.PUBLISH }}"
57
- tags: |
58
- ${{ github.repository }}:latest
59
- ${{ github.repository }}:${{ github.event.release.tag_name || 'manual' }}
@@ -1,5 +0,0 @@
1
- run-name: "Publishing ${{ github.event.release.tag_name || 'manually' }} to Docker Hub[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- trigger:
4
- release:
5
- types: [ "published" ]
@@ -1,7 +0,0 @@
1
- run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }} to Docker Hub[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- depends-on: true
4
- trigger:
5
- workflow_run:
6
- workflows: [ "[__DEPENDS_ON__]" ]
7
- types: [ "completed" ]
@@ -1,8 +0,0 @@
1
- run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }} to Docker Hub[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- depends-on: true
4
- trigger:
5
- workflow_run:
6
- workflows: [ "[__DEPENDS_ON__]" ]
7
- types: [ "completed" ]
8
- jobs-condition: "${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'failure' }}"
@@ -1,8 +0,0 @@
1
- run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }} to Docker Hub[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- depends-on: true
4
- trigger:
5
- workflow_run:
6
- workflows: [ "[__DEPENDS_ON__]" ]
7
- types: [ "completed" ]
8
- jobs-condition: "${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}"
@@ -1,120 +0,0 @@
1
- name: "Publish to GitHub Packages[__WORKFLOW_ID__]"
2
-
3
- run-name: "[__RUN_NAME__]"
4
-
5
- on:
6
- [__TRIGGERS__]
7
- workflow_dispatch:
8
- inputs:
9
- dry-run:
10
- description: "Run without making changes"
11
- required: false
12
- type: "boolean"
13
- default: true
14
-
15
- permissions:
16
- contents: "read"
17
-
18
- concurrency:
19
- group: "${{ github.workflow }}-${{ github.ref }}"
20
- cancel-in-progress: false
21
-
22
- env:
23
- PUBLISH: "[__PUBLISH_CONDITION__]"
24
- ROOT_DIR: "${{ vars.ROOT_WORKING_DIR }}"
25
- NPM_DIR: "${{ vars.NPM_WORKING_DIR }}"
26
-
27
- jobs:
28
- publish-to-github-packages:
29
- runs-on: "ubuntu-latest"
30
- timeout-minutes: 10
31
- [__JOBS_CONDITION__]
32
- permissions:
33
- contents: "read"
34
- packages: "write"
35
- steps:
36
- - name: "Checkout repository"
37
- uses: "actions/checkout@v6"
38
-
39
- - name: "Setup Node.js"
40
- uses: "actions/setup-node@v6"
41
- with:
42
- node-version-file: "${{ env.ROOT_DIR }}/package.json"
43
- package-manager-cache: false
44
-
45
- - name: "Install packages"
46
- run: |
47
- npm install -g npm@latest
48
- npm install
49
- working-directory: "${{ env.ROOT_DIR }}"
50
-
51
- - name: "Check project"
52
- run: |
53
- npm run check
54
- working-directory: "${{ env.ROOT_DIR }}"
55
-
56
- - name: "Build project"
57
- run: |
58
- npm run build
59
- working-directory: "${{ env.ROOT_DIR }}"
60
-
61
- - name: "Configure registry for GitHub Packages"
62
- uses: "actions/setup-node@v6"
63
- with:
64
- node-version-file: "${{ env.ROOT_DIR }}/package.json"
65
- package-manager-cache: false
66
- registry-url: "https://npm.pkg.github.com"
67
- scope: "@${{ github.repository_owner }}"
68
-
69
- - name: "Remove deprecated .npmrc entries"
70
- run: |
71
- npmrc="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
72
-
73
- if [ -f "$npmrc" ]; then
74
- sed -i '/^always-auth=/d' "$npmrc"
75
- fi
76
-
77
- - name: "Change to scoped package name"
78
- run: |
79
- REPOSITORY_OWNER="@$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')"
80
- PACKAGE_NAME=$(npm pkg get name --workspaces=false | jq -r '.')
81
-
82
- echo "[Scope] Owner is \"${REPOSITORY_OWNER}\" and package is \"${PACKAGE_NAME}\"."
83
-
84
- echo "PACKAGE_NAME=$PACKAGE_NAME" >> "$GITHUB_ENV"
85
-
86
- if [[ "$PACKAGE_NAME" != "$REPOSITORY_OWNER/"* ]]; then
87
- BASE=${PACKAGE_NAME##*/}
88
- NEW_NAME="$REPOSITORY_OWNER/$BASE"
89
-
90
- echo "[Scope] Scoping package name to \"${NEW_NAME}\"."
91
-
92
- npm pkg set name="$NEW_NAME"
93
- else
94
- echo "[Scope] Already scoped. No changes needed."
95
- fi
96
- working-directory: "${{ env.NPM_DIR }}"
97
-
98
- - name: "Configure authentication"
99
- env:
100
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
101
- run: |
102
- echo "[Auth] Using GITHUB_TOKEN."
103
- echo "NODE_AUTH_TOKEN=${GITHUB_TOKEN}" >> "$GITHUB_ENV"
104
-
105
- - name: "Publish package to GitHub Packages"
106
- run: |
107
- if [ "${PUBLISH}" = "true" ]; then
108
- echo "[Publish] Production."
109
- npm publish
110
- else
111
- echo "[Publish] Dry run."
112
- npm publish --dry-run
113
- fi
114
- working-directory: "${{ env.NPM_DIR }}"
115
-
116
- - name: "Restore package name"
117
- if: "${{ always() && env.PACKAGE_NAME }}"
118
- run: |
119
- npm pkg set name="$PACKAGE_NAME"
120
- working-directory: "${{ env.NPM_DIR }}"
@@ -1,5 +0,0 @@
1
- run-name: "Publishing ${{ github.event.release.tag_name || 'manually' }} to GitHub Packages[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- trigger:
4
- release:
5
- types: [ "published" ]
@@ -1,7 +0,0 @@
1
- run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }} to GitHub Packages[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- depends-on: true
4
- trigger:
5
- workflow_run:
6
- workflows: [ "[__DEPENDS_ON__]" ]
7
- types: [ "completed" ]
@@ -1,8 +0,0 @@
1
- run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }} to GitHub Packages[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- depends-on: true
4
- trigger:
5
- workflow_run:
6
- workflows: [ "[__DEPENDS_ON__]" ]
7
- types: [ "completed" ]
8
- jobs-condition: "${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'failure' }}"
@@ -1,8 +0,0 @@
1
- run-name: "Publishing ${{ github.event.workflow_run.head_branch || 'manually' }} to GitHub Packages[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'workflow_run' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- depends-on: true
4
- trigger:
5
- workflow_run:
6
- workflows: [ "[__DEPENDS_ON__]" ]
7
- types: [ "completed" ]
8
- jobs-condition: "${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}"
@@ -1,79 +0,0 @@
1
- name: "Publish to GitHub Pages / Docusaurus[__WORKFLOW_ID__]"
2
-
3
- run-name: "[__RUN_NAME__]"
4
-
5
- on:
6
- [__TRIGGERS__]
7
- workflow_dispatch:
8
- inputs:
9
- dry-run:
10
- description: "Run without making changes"
11
- required: false
12
- type: "boolean"
13
- default: true
14
-
15
- permissions:
16
- contents: "read"
17
- id-token: "write"
18
- pages: "write"
19
-
20
- concurrency:
21
- group: "${{ github.workflow }}-${{ github.ref }}"
22
- cancel-in-progress: false
23
-
24
- env:
25
- PUBLISH: "[__PUBLISH_CONDITION__]"
26
- ROOT_DIR: "${{ vars.ROOT_WORKING_DIR }}"
27
- DOCUSAURUS_DIR: "${{ vars.DOCUSAURUS_WORKING_DIR }}"
28
-
29
- jobs:
30
- publish-to-github-pages:
31
- runs-on: "ubuntu-latest"
32
- timeout-minutes: 10
33
- [__JOBS_CONDITION__]
34
- steps:
35
- - name: "Checkout repository"
36
- uses: "actions/checkout@v6"
37
-
38
- - name: "Setup Node.js"
39
- uses: "actions/setup-node@v6"
40
- with:
41
- node-version-file: "${{ env.ROOT_DIR }}/package.json"
42
- package-manager-cache: false
43
-
44
- - name: "Install packages"
45
- run: |
46
- npm install -g npm@latest
47
- npm install
48
- working-directory: "${{ env.ROOT_DIR }}"
49
-
50
- - name: "Build project"
51
- run: |
52
- npm run build
53
- working-directory: "${{ env.ROOT_DIR }}"
54
-
55
- - name: "Check GitHub Pages status"
56
- run: |
57
- if gh api "repos/${{ github.repository }}/pages" > /dev/null 2>&1; then
58
- echo "[Pages] GitHub Pages is enabled."
59
- echo "PAGES_ENABLED=true" >> "$GITHUB_ENV"
60
- else
61
- echo "[Pages] GitHub Pages is not enabled. Skipping deployment."
62
- echo "PAGES_ENABLED=false" >> "$GITHUB_ENV"
63
- fi
64
- env:
65
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
66
-
67
- - name: "Setup GitHub Pages"
68
- if: "${{ env.PUBLISH == 'true' && env.PAGES_ENABLED == 'true' }}"
69
- uses: "actions/configure-pages@v5"
70
-
71
- - name: "Upload artifact to GitHub Pages"
72
- if: "${{ env.PUBLISH == 'true' && env.PAGES_ENABLED == 'true' }}"
73
- uses: "actions/upload-pages-artifact@v4"
74
- with:
75
- path: "${{ env.DOCUSAURUS_DIR }}/build"
76
-
77
- - name: "Deploy to GitHub Pages"
78
- if: "${{ env.PUBLISH == 'true' && env.PAGES_ENABLED == 'true' }}"
79
- uses: "actions/deploy-pages@v4"
@@ -1,5 +0,0 @@
1
- run-name: "Publishing ${{ github.ref_name || 'manually' }} to GitHub Pages / Docusaurus[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- trigger:
4
- push:
5
- branches: [ "main" ]
@@ -1,5 +0,0 @@
1
- run-name: "Publishing ${{ github.event.release.tag_name || 'manually' }} to GitHub Pages / Docusaurus[__WORKFLOW_ID__]${{ github.event_name == 'workflow_dispatch' && inputs.dry-run && ' (dry run)' || '' }}"
2
- publish-condition: "${{ github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && !inputs.dry-run) }}"
3
- trigger:
4
- release:
5
- types: [ "published" ]
@@ -1,97 +0,0 @@
1
- name: "Publish to npm[__WORKFLOW_ID__]"
2
-
3
- run-name: "[__RUN_NAME__]"
4
-
5
- on:
6
- [__TRIGGERS__]
7
- workflow_dispatch:
8
- inputs:
9
- dry-run:
10
- description: "Run without making changes"
11
- required: false
12
- type: "boolean"
13
- default: true
14
-
15
- permissions:
16
- contents: "read"
17
-
18
- concurrency:
19
- group: "${{ github.workflow }}-${{ github.ref }}"
20
- cancel-in-progress: false
21
-
22
- env:
23
- PUBLISH: "[__PUBLISH_CONDITION__]"
24
- ROOT_DIR: "${{ vars.ROOT_WORKING_DIR }}"
25
- NPM_DIR: "${{ vars.NPM_WORKING_DIR }}"
26
-
27
- jobs:
28
- publish-to-npm:
29
- runs-on: "ubuntu-latest"
30
- timeout-minutes: 10
31
- [__JOBS_CONDITION__]
32
- permissions:
33
- contents: "read"
34
- id-token: "write"
35
- steps:
36
- - name: "Checkout repository"
37
- uses: "actions/checkout@v6"
38
-
39
- - name: "Setup Node.js"
40
- uses: "actions/setup-node@v6"
41
- with:
42
- node-version-file: "${{ env.ROOT_DIR }}/package.json"
43
- package-manager-cache: false
44
- registry-url: "https://registry.npmjs.org"
45
-
46
- - name: "Remove deprecated .npmrc entries"
47
- run: |
48
- npmrc="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
49
-
50
- if [ -f "$npmrc" ]; then
51
- sed -i '/^always-auth=/d' "$npmrc"
52
- fi
53
-
54
- - name: "Install packages"
55
- run: |
56
- npm install -g npm@latest
57
- npm install
58
- working-directory: "${{ env.ROOT_DIR }}"
59
-
60
- - name: "Check project"
61
- run: |
62
- npm run check
63
- working-directory: "${{ env.ROOT_DIR }}"
64
-
65
- - name: "Build project"
66
- run: |
67
- npm run build
68
- working-directory: "${{ env.ROOT_DIR }}"
69
-
70
- - name: "Configure authentication"
71
- env:
72
- NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
73
- run: |
74
- if [ -n "${NPM_TOKEN}" ]; then
75
- echo "[Auth] Using NPM_TOKEN (token-based)."
76
- echo "NODE_AUTH_TOKEN=${NPM_TOKEN}" >> "$GITHUB_ENV"
77
- else
78
- echo "[Auth] Using trusted publishing (OIDC)."
79
-
80
- npmrc="${NPM_CONFIG_USERCONFIG:-$HOME/.npmrc}"
81
-
82
- if [ -f "$npmrc" ]; then
83
- sed -i '/^\/\/registry\.npmjs\.org\/:_authToken/d' "$npmrc"
84
- echo "[Auth] Removed _authToken entry from .npmrc."
85
- fi
86
- fi
87
-
88
- - name: "Publish package to npm"
89
- run: |
90
- if [ "${PUBLISH}" = "true" ]; then
91
- echo "[Publish] Production."
92
- npm publish
93
- else
94
- echo "[Publish] Dry run."
95
- npm publish --dry-run
96
- fi
97
- working-directory: "${{ env.NPM_DIR }}"