@underpostnet/cyberia 3.3.76 → 3.4.0

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 (132) hide show
  1. package/.env.example +1 -0
  2. package/.github/workflows/coverall.cyberia.ci.yml +17 -3
  3. package/.github/workflows/cyberia-client.cd.yml +2 -1
  4. package/.github/workflows/cyberia-server.cd.yml +2 -1
  5. package/.github/workflows/docker-image.cyberia-client.ci.yml +1 -1
  6. package/.github/workflows/docker-image.cyberia-client.dev.ci.yml +1 -1
  7. package/.github/workflows/docker-image.cyberia-server.ci.yml +1 -1
  8. package/.github/workflows/docker-image.cyberia-server.dev.ci.yml +1 -1
  9. package/.github/workflows/docker-image.engine-cyberia.ci.yml +1 -1
  10. package/.github/workflows/docker-image.engine-cyberia.dev.ci.yml +1 -1
  11. package/.github/workflows/engine-cyberia.ci.yml +7 -1
  12. package/.github/workflows/ghpkg.ci.yml +19 -2
  13. package/.github/workflows/gitlab.ci.yml +8 -6
  14. package/.github/workflows/hardhat.ci.yml +4 -1
  15. package/.github/workflows/npmpkg.ci.yml +9 -5
  16. package/.github/workflows/publish.ci.yml +21 -12
  17. package/.github/workflows/publish.cyberia.ci.yml +25 -14
  18. package/.github/workflows/pwa-microservices-template-page.cd.yml +4 -2
  19. package/CHANGELOG.md +110 -262
  20. package/CLI-HELP.md +29 -2
  21. package/Dockerfile +1 -1
  22. package/Dockerfile.dev +1 -1
  23. package/Dockerfile.test +1 -1
  24. package/README.md +1 -1
  25. package/bin/build.js +67 -14
  26. package/bin/cyberia.js +4 -4
  27. package/bin/index.js +4 -4
  28. package/compose.env +1 -0
  29. package/conf.js +1 -1043
  30. package/deploy/cyberia-client/deploy.sh +13 -11
  31. package/deploy/cyberia-server/deploy.sh +13 -11
  32. package/deploy/dd-cyberia/sync-deploy.sh +7 -28
  33. package/deploy/lib/config.sh +1 -1
  34. package/deploy/lib/github-actions-logging.sh +3 -2
  35. package/deploy/lib/host.sh +1 -1
  36. package/deploy/pwa-microservices-template/deploy.sh +7 -1
  37. package/deployment.yaml +1 -1
  38. package/docker-compose.yml +7 -7
  39. package/docs/coverage/cyberia/api/cyberia-instance/cyberia-fallback-capture.js.html +1591 -0
  40. package/docs/coverage/cyberia/api/cyberia-instance/index.html +116 -0
  41. package/docs/coverage/cyberia/api/cyberia-server-defaults/cyberia-server-defaults.js.html +4138 -0
  42. package/docs/coverage/cyberia/api/cyberia-server-defaults/index.html +116 -0
  43. package/docs/coverage/cyberia/api/object-layer/index.html +116 -0
  44. package/docs/coverage/cyberia/api/object-layer/object-layer.model.js.html +1393 -0
  45. package/docs/coverage/cyberia/base.css +362 -0
  46. package/docs/coverage/cyberia/block-navigation.js +82 -0
  47. package/docs/coverage/cyberia/favicon.png +0 -0
  48. package/docs/coverage/cyberia/index.html +161 -0
  49. package/docs/coverage/cyberia/prettify.css +101 -0
  50. package/docs/coverage/cyberia/prettify.js +937 -0
  51. package/docs/coverage/cyberia/projects/cyberia/atlas-sprite-sheet-generator.js.html +1315 -0
  52. package/docs/coverage/cyberia/projects/cyberia/index.html +176 -0
  53. package/docs/coverage/cyberia/projects/cyberia/instance-backup.js.html +715 -0
  54. package/docs/coverage/cyberia/projects/cyberia/instance-data.js.html +2182 -0
  55. package/docs/coverage/cyberia/projects/cyberia/shape-generator.js.html +3265 -0
  56. package/docs/coverage/cyberia/projects/cyberia/stat-balance.js.html +328 -0
  57. package/docs/coverage/cyberia/sort-arrow-sprite.png +0 -0
  58. package/docs/coverage/cyberia/sorter.js +205 -0
  59. package/hardhat/package-lock.json +6 -6
  60. package/hardhat/package.json +2 -2
  61. package/manifests/cronjobs/dd-cron/dd-cron-backup.yaml +1 -1
  62. package/manifests/cronjobs/dd-cron/dd-cron-vultr.yaml +1 -1
  63. package/manifests/deployment/dd-cyberia-development/deployment.yaml +1 -1
  64. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  65. package/package.json +19 -17
  66. package/scripts/test-monitor.sh +1 -1
  67. package/src/api/file/file.router.js +7 -1
  68. package/src/cli/baremetal.js +1 -1
  69. package/src/cli/cluster.js +73 -18
  70. package/src/cli/deploy.js +211 -30
  71. package/src/cli/docker-compose.js +1 -1
  72. package/src/cli/index.js +36 -0
  73. package/src/cli/kubectl.js +4 -3
  74. package/src/cli/release.js +5 -1
  75. package/src/cli/repository.js +14 -11
  76. package/src/cli/run.js +10 -3
  77. package/src/cli/secrets.js +393 -200
  78. package/src/cli/socketsecurity.js +260 -0
  79. package/src/client/components/core/Badge.js +0 -1
  80. package/src/client/components/core/CssCore.js +11 -1
  81. package/src/client/components/core/Modal.js +189 -66
  82. package/src/client/components/core/SearchBox.js +0 -1
  83. package/src/client/components/core/ToolTip.js +15 -0
  84. package/src/client/components/cryptokoyn/AppShellCryptokoyn.js +0 -2
  85. package/src/client/components/cyberia-portal/RouterCyberiaPortal.js +0 -4
  86. package/src/client/components/default/AppShellDefault.js +1 -4
  87. package/src/client/components/itemledger/AppShellItemledger.js +0 -2
  88. package/src/client/components/underpost/AppShellUnderpost.js +12 -0
  89. package/src/client/components/underpost/CssUnderpost.js +15 -2
  90. package/src/client/public/cyberia-docs/CYBERIA-CLIENT.md +8 -0
  91. package/src/client/public/cyberia-docs/CYBERIA.md +1 -1
  92. package/src/client/public/cyberia-docs/OFF-CHAIN-ECONOMY.md +54 -56
  93. package/src/client/public/cyberia-docs/ROADMAP.md +1 -1
  94. package/src/client/public/cyberia-docs/UNDERPOST-PLATFORM.md +30 -29
  95. package/src/client/public/cyberia-docs/WHITE-PAPER.md +1 -1
  96. package/src/client/ssr/body/UnderpostDefaultSplashScreen.js +54 -25
  97. package/src/client/ssr/head/Css.js +12 -10
  98. package/src/client/ssr/views/Cyberia404.js +9 -13
  99. package/src/client/ssr/views/NotFound.js +75 -0
  100. package/src/client-builder/client-bundle.js +2 -2
  101. package/src/index.js +13 -1
  102. package/src/runtime/engine-cyberia/Dockerfile +1 -1
  103. package/src/runtime/engine-cyberia/Dockerfile.dev +1 -1
  104. package/src/runtime/engine-cyberia/Dockerfile.test +1 -1
  105. package/src/runtime/engine-cyberia/compose.env +1 -0
  106. package/src/runtime/engine-cyberia/docker-compose.yml +7 -7
  107. package/src/server/build/catalog.js +1 -0
  108. package/src/server/build/execution.js +19 -5
  109. package/src/server/build/package.js +166 -3
  110. package/src/server/build/testing.js +2 -1
  111. package/src/server/network/underpost-gateway.js +113 -14
  112. package/src/server/runtime/conf.js +57 -7
  113. package/src/server/runtime/config-scope.js +2 -0
  114. package/src/server/runtime/process.js +4 -3
  115. package/src/server/runtime/start.js +11 -2
  116. package/src/server/security/socketsecurity.js +1735 -0
  117. package/test/integration/infra/1-security/config-scope.test.js +3 -0
  118. package/test/integration/infra/1-security/socketsecurity.test.js +1041 -0
  119. package/test/integration/infra/1-security/sops-secret-store.test.js +201 -71
  120. package/test/integration/infra/4-ingress/underpost-ingress.test.js +1 -1
  121. package/test/unit/build-template.test.js +24 -0
  122. package/test/unit/catalog.test.js +13 -2
  123. package/test/unit/conf-resolution.test.js +41 -7
  124. package/test/unit/cyberia/instance-data.test.js +314 -0
  125. package/test/unit/deploy-legacy-gateway-sweep.test.js +63 -0
  126. package/test/unit/deploy-log-table.test.js +38 -0
  127. package/test/unit/execution-profiles.test.js +1 -0
  128. package/test/unit/gateway-pod-fetch.test.js +95 -0
  129. package/test/unit/letsencrypt-issuer.test.js +101 -0
  130. package/test/unit/package.test.js +118 -0
  131. package/test/unit/release-bump.test.js +3 -1
  132. package/test/unit/start-options.test.js +12 -0
package/.env.example CHANGED
@@ -24,6 +24,7 @@ IPFS_CLUSTER_IMAGE=ipfs/ipfs-cluster:latest
24
24
  # The engine-cyberia image ships only the underpost CLI; at start it runs the
25
25
  # `underpost start --build` bootstrap, which clones ${GITHUB_USERNAME}/engine-cyberia.
26
26
  GITHUB_USERNAME=underpostnet
27
+ GITHUB_ORG_NAME=underpost
27
28
  GITHUB_TOKEN=change_me_private_repo_token
28
29
 
29
30
  # --- MongoDB (translation of Secret mongodb-secret) --------------------------
@@ -15,8 +15,11 @@ jobs:
15
15
  if: |
16
16
  github.actor != 'dependabot[bot]' &&
17
17
  (github.repository == 'underpostnet/engine-cyberia' ||
18
+ github.repository == 'underpost/engine-cyberia' ||
18
19
  github.repository == 'underpostnet/engine-ghpkg-cyberia' ||
19
- github.repository == 'underpostnet/engine-test-cyberia')
20
+ github.repository == 'underpost/engine-ghpkg-cyberia' ||
21
+ github.repository == 'underpostnet/engine-test-cyberia' ||
22
+ github.repository == 'underpost/engine-test-cyberia')
20
23
  runs-on: ubuntu-latest
21
24
  container:
22
25
  image: quay.io/rockylinux/rockylinux:9
@@ -42,6 +45,11 @@ jobs:
42
45
  - name: Install project dependencies
43
46
  run: npm install
44
47
 
48
+ # The cyberia tier imports the modules its catalog pins (jimp, pngjs, ethers, ...),
49
+ # which the engine manifest does not carry.
50
+ - name: Install cyberia catalog dependencies
51
+ run: node bin package dd-cyberia --install
52
+
45
53
  # Set the COVERAGE_MIN repository variable to gate below the shipped
46
54
  # default while the suite is catching up to it.
47
55
  - name: Run tests and enforce coverage threshold
@@ -69,8 +77,11 @@ jobs:
69
77
  !cancelled() &&
70
78
  github.actor != 'dependabot[bot]' &&
71
79
  (github.repository == 'underpostnet/engine-cyberia' ||
80
+ github.repository == 'underpost/engine-cyberia' ||
72
81
  github.repository == 'underpostnet/engine-ghpkg-cyberia' ||
73
- github.repository == 'underpostnet/engine-test-cyberia')
82
+ github.repository == 'underpost/engine-ghpkg-cyberia' ||
83
+ github.repository == 'underpostnet/engine-test-cyberia' ||
84
+ github.repository == 'underpost/engine-test-cyberia')
74
85
  runs-on: ubuntu-latest
75
86
  steps:
76
87
  # Coveralls reads the commit and branch metadata from the checkout.
@@ -101,8 +112,11 @@ jobs:
101
112
  !cancelled() &&
102
113
  github.actor != 'dependabot[bot]' &&
103
114
  (github.repository == 'underpostnet/engine-cyberia' ||
115
+ github.repository == 'underpost/engine-cyberia' ||
104
116
  github.repository == 'underpostnet/engine-ghpkg-cyberia' ||
105
- github.repository == 'underpostnet/engine-test-cyberia')
117
+ github.repository == 'underpost/engine-ghpkg-cyberia' ||
118
+ github.repository == 'underpostnet/engine-test-cyberia' ||
119
+ github.repository == 'underpost/engine-test-cyberia')
106
120
  runs-on: ubuntu-latest
107
121
  steps:
108
122
  - name: Notify Coveralls Finished
@@ -16,7 +16,8 @@ permissions:
16
16
  jobs:
17
17
  deploy:
18
18
  if: >-
19
- github.repository == 'underpostnet/cyberia-client'
19
+ (github.repository == 'underpostnet/cyberia-client' ||
20
+ github.repository == 'underpost/cyberia-client')
20
21
  && github.event.inputs.job == 'deploy'
21
22
  name: Remote SSH deployment
22
23
  runs-on: ubuntu-latest
@@ -16,7 +16,8 @@ permissions:
16
16
  jobs:
17
17
  deploy:
18
18
  if: >-
19
- github.repository == 'underpostnet/cyberia-server'
19
+ (github.repository == 'underpostnet/cyberia-server' ||
20
+ github.repository == 'underpost/cyberia-server')
20
21
  && github.event.inputs.job == 'deploy'
21
22
  name: Remote SSH deployment
22
23
  runs-on: ubuntu-latest
@@ -4,7 +4,7 @@ on:
4
4
  workflow_dispatch:
5
5
 
6
6
  env:
7
- UNDERPOST_VERSION: '3.3.76'
7
+ UNDERPOST_VERSION: '3.4.0'
8
8
 
9
9
  jobs:
10
10
  build-and-push:
@@ -4,7 +4,7 @@ on:
4
4
  workflow_dispatch:
5
5
 
6
6
  env:
7
- UNDERPOST_VERSION: '3.3.76'
7
+ UNDERPOST_VERSION: '3.4.0'
8
8
 
9
9
  jobs:
10
10
  build-and-push:
@@ -4,7 +4,7 @@ on:
4
4
  workflow_dispatch:
5
5
 
6
6
  env:
7
- UNDERPOST_VERSION: '3.3.76'
7
+ UNDERPOST_VERSION: '3.4.0'
8
8
 
9
9
  jobs:
10
10
  build-and-push:
@@ -4,7 +4,7 @@ on:
4
4
  workflow_dispatch:
5
5
 
6
6
  env:
7
- UNDERPOST_VERSION: '3.3.76'
7
+ UNDERPOST_VERSION: '3.4.0'
8
8
 
9
9
  jobs:
10
10
  build-and-push:
@@ -4,7 +4,7 @@ on:
4
4
  workflow_dispatch:
5
5
 
6
6
  env:
7
- UNDERPOST_VERSION: '3.3.76'
7
+ UNDERPOST_VERSION: '3.4.0'
8
8
 
9
9
  jobs:
10
10
  build-and-push:
@@ -4,7 +4,7 @@ on:
4
4
  workflow_dispatch:
5
5
 
6
6
  env:
7
- UNDERPOST_VERSION: '3.3.76'
7
+ UNDERPOST_VERSION: '3.4.0'
8
8
 
9
9
  jobs:
10
10
  build-and-push:
@@ -79,7 +79,7 @@ jobs:
79
79
  cd engine
80
80
  git clone --depth 1 --no-checkout https://$GITHUB_TOKEN@github.com/underpostnet/engine-private.git ./engine-private
81
81
  cd ./engine-private && git sparse-checkout set conf/dd-cyberia && git checkout && cd ..
82
- node bin/build dd-cyberia development
82
+ node bin/build dd-cyberia development --coverage
83
83
  cd ../pwa-microservices-template
84
84
  rm -rf ./.git
85
85
  mv ../engine-cyberia.git ./.git
@@ -97,6 +97,12 @@ jobs:
97
97
  else
98
98
  git commit -m "$LAST_COMMIT_MESSAGE"
99
99
  node ../engine/bin push . underpostnet/engine-cyberia
100
+ MIRROR_PAYLOAD=$(REPO=engine-cyberia node -e 'process.stdout.write(JSON.stringify({ ref: "master", inputs: { repos: process.env.REPO } }))')
101
+ curl -sS -f -X POST \
102
+ -H "Accept: application/vnd.github.v3+json" \
103
+ -H "Authorization: token ${GITHUB_TOKEN}" \
104
+ "https://api.github.com/repos/underpostnet/engine/actions/workflows/mirror-to-org.yml/dispatches" \
105
+ -d "$MIRROR_PAYLOAD"
100
106
  echo "[INFO] Dispatching canonical github package build engine-ghpkg-cyberia"
101
107
  GHPKG_PAYLOAD=$(MSG="$LAST_COMMIT_MESSAGE" node -e '
102
108
  const i = { conf_id: "cyberia" };
@@ -21,7 +21,7 @@ permissions:
21
21
  jobs:
22
22
  pwa-microservices-template-ghpk:
23
23
  if: >-
24
- github.repository == 'underpostnet/pwa-microservices-template' &&
24
+ (github.repository == 'underpostnet/pwa-microservices-template') &&
25
25
  (
26
26
  startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template-ghpkg)')
27
27
  ||
@@ -94,12 +94,23 @@ jobs:
94
94
  git config user.name 'underpostnet'
95
95
  git config user.email 'fcoverdugoa@underpost.net'
96
96
  git add .
97
+ # Installed modules never enter the package repository; a deletion is the cleanup and passes.
98
+ if git diff --cached --name-only --diff-filter=AM | grep -q '^node_modules/'; then
99
+ echo "::error::node_modules is staged for commit; the template .gitignore must ignore it."
100
+ exit 1
101
+ fi
97
102
  git status
98
103
  git commit -m "$LAST_COMMIT_MESSAGE"
99
104
  node bin push . underpostnet/pwa-microservices-template-ghpkg
105
+ MIRROR_PAYLOAD=$(REPO=pwa-microservices-template-ghpkg node -e 'process.stdout.write(JSON.stringify({ ref: "master", inputs: { repos: process.env.REPO } }))')
106
+ curl -sS -f -X POST \
107
+ -H "Accept: application/vnd.github.v3+json" \
108
+ -H "Authorization: token ${GITHUB_TOKEN}" \
109
+ "https://api.github.com/repos/underpostnet/engine/actions/workflows/mirror-to-org.yml/dispatches" \
110
+ -d "$MIRROR_PAYLOAD"
100
111
 
101
112
  engine-ghpkg:
102
- if: github.repository == 'underpostnet/engine' && github.event_name == 'workflow_dispatch'
113
+ if: (github.repository == 'underpostnet/engine' || github.repository == 'underpost/engine') && github.event_name == 'workflow_dispatch'
103
114
  name: Build engine ${{ github.event.inputs.conf_id || 'cyberia' }} ghpkg repository
104
115
  runs-on: ubuntu-latest
105
116
  container:
@@ -178,4 +189,10 @@ jobs:
178
189
  else
179
190
  git commit -m "$LAST_COMMIT_MESSAGE"
180
191
  node ../engine/bin push . underpostnet/$GHPKG_REPO
192
+ MIRROR_PAYLOAD=$(REPO="$GHPKG_REPO" node -e 'process.stdout.write(JSON.stringify({ ref: "master", inputs: { repos: process.env.REPO } }))')
193
+ curl -sS -f -X POST \
194
+ -H "Accept: application/vnd.github.v3+json" \
195
+ -H "Authorization: token ${GITHUB_TOKEN}" \
196
+ "https://api.github.com/repos/underpostnet/engine/actions/workflows/mirror-to-org.yml/dispatches" \
197
+ -d "$MIRROR_PAYLOAD"
181
198
  fi
@@ -1,20 +1,22 @@
1
1
  name: CI | Publish gitlab repository package
2
+
2
3
  on: [push]
4
+
3
5
  jobs:
4
6
  pwa-microservices-template:
5
- if: github.repository == 'underpostnet/pwa-microservices-template' && startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template-ghpkg)')
7
+ if: github.repository == 'underpost/pwa-microservices-template'
6
8
  name: Update gitlab repo package Jobs
7
9
  runs-on: ubuntu-latest
10
+
8
11
  steps:
9
12
  - uses: actions/checkout@v7
10
13
  with:
11
14
  fetch-depth: 0
12
- lfs: true
15
+
13
16
  - name: Push to GitLab
14
17
  run: |
15
- git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/underpostnet/pwa-microservices-template.git
16
- git lfs install
17
- git lfs fetch --all
18
- git lfs push --all gitlab
18
+ git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/underpost/pwa-microservices-template.git
19
+ git config user.name 'underpostnet'
20
+ git config user.email 'development@underpost.net'
19
21
  git push gitlab HEAD:main --force
20
22
  git push gitlab --force --tags
@@ -20,8 +20,11 @@ jobs:
20
20
  if: |
21
21
  github.actor != 'dependabot[bot]' &&
22
22
  (github.repository == 'underpostnet/engine-cyberia' ||
23
+ github.repository == 'underpost/engine-cyberia' ||
23
24
  github.repository == 'underpostnet/engine-ghpkg-cyberia' ||
24
- github.repository == 'underpostnet/engine-test-cyberia')
25
+ github.repository == 'underpost/engine-ghpkg-cyberia' ||
26
+ github.repository == 'underpostnet/engine-test-cyberia' ||
27
+ github.repository == 'underpost/engine-test-cyberia')
25
28
  runs-on: ubuntu-latest
26
29
  defaults:
27
30
  run:
@@ -25,7 +25,7 @@ permissions:
25
25
  jobs:
26
26
  pwa-microservices-template:
27
27
  if: |
28
- github.repository == 'underpostnet/engine'
28
+ (github.repository == 'underpostnet/engine' || github.repository == 'underpost/engine')
29
29
  && (
30
30
  startsWith(github.event.head_commit.message, 'ci(package-pwa-microservices-template')
31
31
  || github.event_name == 'workflow_dispatch'
@@ -100,10 +100,14 @@ jobs:
100
100
  node ../engine/bin push . underpostnet/pwa-microservices-template
101
101
  fi
102
102
 
103
+ # A failed dispatch fails the run: its success is what the organization mirror waits on.
103
104
  - name: Dispatch all engine CIs
105
+ env:
106
+ # Never interpolated into the script: a dispatch input is free text.
107
+ DEPLOY_CONF_ID: ${{ github.event.inputs.deploy_conf_id }}
108
+ DEPLOY_TYPE: ${{ github.event.inputs.deploy_type }}
109
+ GIT_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
104
110
  run: |
105
- DEPLOY_CONF_ID="${{ github.event.inputs.deploy_conf_id }}"
106
- DEPLOY_TYPE="${{ github.event.inputs.deploy_type }}"
107
111
  for ENGINE in engine-core engine-prototype engine-cyberia engine-lampp engine-test; do
108
112
  SYNC="false"
109
113
  DT=""
@@ -120,9 +124,9 @@ jobs:
120
124
  if (process.env.MSG) i.message = process.env.MSG;
121
125
  process.stdout.write(JSON.stringify({ ref: "master", inputs: i }));
122
126
  ')
123
- curl -s -X POST \
127
+ curl -sS -f -X POST \
124
128
  -H "Accept: application/vnd.github.v3+json" \
125
- -H "Authorization: token ${{ secrets.GIT_AUTH_TOKEN }}" \
129
+ -H "Authorization: token ${GIT_AUTH_TOKEN}" \
126
130
  "https://api.github.com/repos/underpostnet/engine/actions/workflows/${ENGINE}.ci.yml/dispatches" \
127
131
  -d "$PAYLOAD"
128
132
  done
@@ -9,8 +9,9 @@ permissions:
9
9
  id-token: write
10
10
  jobs:
11
11
  build-and-publish:
12
- # prevents this action from running on forks
13
- if: github.repository == 'underpostnet/pwa-microservices-template'
12
+ # The unscoped `underpost` package has one publisher: a version can be published once, and
13
+ # the organization mirror publishes the owner-scoped package from its ghpkg repository.
14
+ if: (github.repository == 'underpostnet/pwa-microservices-template' || github.repository == 'underpost/pwa-microservices-template')
14
15
  runs-on: ubuntu-latest
15
16
  permissions:
16
17
  contents: write
@@ -42,12 +43,15 @@ jobs:
42
43
  curl -s -f -X POST \
43
44
  -H "Accept: application/vnd.github.v3+json" \
44
45
  -H "Authorization: token ${{ secrets.GIT_AUTH_TOKEN }}" \
45
- "https://api.github.com/repos/underpostnet/pwa-microservices-template/actions/workflows/release.cd.yml/dispatches" \
46
+ "https://api.github.com/repos/${{ github.repository }}/actions/workflows/release.cd.yml/dispatches" \
46
47
  -d '{"ref":"master"}'
47
48
 
48
49
  build-and-publish-ghpkg:
49
- # prevents this action from running on forks
50
- if: github.repository == 'underpostnet/pwa-microservices-template-ghpkg'
50
+ # The scoped package takes the repository owner as its scope, so the personal account and the
51
+ # organization mirror each publish their own; any other owner is a fork.
52
+ if: >-
53
+ github.event.repository.name == 'pwa-microservices-template-ghpkg' &&
54
+ contains(fromJSON('["underpostnet","underpost"]'), github.repository_owner)
51
55
  runs-on: ubuntu-latest
52
56
  permissions:
53
57
  contents: write
@@ -60,11 +64,17 @@ jobs:
60
64
  with:
61
65
  node-version: '24.x'
62
66
  registry-url: 'https://registry.npmjs.org'
63
- scope: '@underpostnet'
67
+ scope: '@${{ github.repository_owner }}'
64
68
 
65
69
  - name: Install Dependencies
66
70
  run: npm ci
67
71
 
72
+ # The committed manifest names the personal account. Provenance is refused when the
73
+ # manifest's repository differs from the one the workflow runs in, and GitHub Packages
74
+ # accepts only the owner's scope, so both follow the owner here — a no-op on the source.
75
+ - name: Align the package identity with the repository owner
76
+ run: node bin package --rename "@${{ github.repository_owner }}/underpost" --set-repo "${{ github.repository }}"
77
+
68
78
  - name: Publish to npm
69
79
  env:
70
80
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -75,13 +85,12 @@ jobs:
75
85
  with:
76
86
  node-version: '24.x'
77
87
  registry-url: 'https://npm.pkg.github.com'
78
- scope: '@underpostnet'
88
+ scope: '@${{ github.repository_owner }}'
79
89
 
80
90
  - name: Publish to GitHub Packages
81
- run: |
82
- npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GIT_AUTH_TOKEN }}
83
- echo "//npm.pkg.github.com/:_authToken=${{ secrets.GIT_AUTH_TOKEN }}" > ~/.npmrc
84
- echo "@underpostnet:registry=https://npm.pkg.github.com" >> ~/.npmrc
85
- npm publish
86
91
  env:
87
92
  NODE_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
93
+ run: |
94
+ echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
95
+ echo "@${{ github.repository_owner }}:registry=https://npm.pkg.github.com" >> ~/.npmrc
96
+ npm publish
@@ -9,8 +9,9 @@ permissions:
9
9
  id-token: write
10
10
  jobs:
11
11
  build-and-publish:
12
- # prevents this action from running on forks
13
- if: github.repository == 'underpostnet/engine-cyberia'
12
+ # The unscoped `cyberia` package has one publisher: a version can be published once, and the
13
+ # organization mirror publishes the owner-scoped package from its ghpkg repository.
14
+ if: (github.repository == 'underpostnet/engine-cyberia' || github.repository == 'underpost/engine-cyberia')
14
15
  runs-on: ubuntu-latest
15
16
  permissions:
16
17
  contents: write
@@ -60,8 +61,11 @@ jobs:
60
61
  run: npm publish --provenance --access public
61
62
 
62
63
  build-and-publish-ghpkg:
63
- # prevents this action from running on forks
64
- if: github.repository == 'underpostnet/engine-ghpkg-cyberia'
64
+ # The scoped package takes the repository owner as its scope, so the personal account and the
65
+ # organization mirror each publish their own; any other owner is a fork.
66
+ if: >-
67
+ github.event.repository.name == 'engine-ghpkg-cyberia' &&
68
+ contains(fromJSON('["underpostnet","underpost"]'), github.repository_owner)
65
69
  runs-on: ubuntu-latest
66
70
  permissions:
67
71
  contents: write
@@ -74,15 +78,22 @@ jobs:
74
78
  with:
75
79
  node-version: '24.x'
76
80
  registry-url: 'https://registry.npmjs.org'
77
- scope: '@underpostnet'
81
+ scope: '@${{ github.repository_owner }}'
78
82
 
79
83
  - name: Install Dependencies
80
84
  run: npm ci
81
85
 
86
+ # The committed manifest names the personal account. Provenance is refused when the
87
+ # manifest's repository differs from the one the workflow runs in, and GitHub Packages
88
+ # accepts only the owner's scope, so both follow the owner here — a no-op on the source.
89
+ - name: Align the package identity with the repository owner
90
+ run: node bin package --rename "@${{ github.repository_owner }}/cyberia" --set-repo "${{ github.repository }}"
91
+
82
92
  # The repository declares the engine's runtime dependencies because it runs the engine
83
- # source it ships; a registry consumer gets them through `underpost` instead. This restores
84
- # the manifest the package published before that split, and only in the tarball — after
85
- # `npm ci`, so the lockfile the checkout installs from is the repository's own.
93
+ # source it ships; a registry consumer gets them through `@underpost/underpost` instead,
94
+ # because the scoped package is what GitHub Packages resolves. This restores the manifest
95
+ # the package published before that split, and only in the tarball after `npm ci`, so
96
+ # the lockfile the checkout installs from is the repository's own.
86
97
  - name: Restore the published dependency set
87
98
  run: |
88
99
  node --input-type=module -e '
@@ -93,6 +104,7 @@ jobs:
93
104
  const published = publishedProductPackageJson({
94
105
  packageJson,
95
106
  catalog: await loadDeployCatalog("dd-cyberia"),
107
+ underpostPackageName: "@${{ github.repository_owner }}/underpost",
96
108
  });
97
109
  fs.writeFileSync("./package.json", JSON.stringify(published, null, DEPLOY_MANIFEST_INDENT) + "\n", "utf8");
98
110
  console.log("published manifest", {
@@ -111,13 +123,12 @@ jobs:
111
123
  with:
112
124
  node-version: '24.x'
113
125
  registry-url: 'https://npm.pkg.github.com'
114
- scope: '@underpostnet'
126
+ scope: '@${{ github.repository_owner }}'
115
127
 
116
128
  - name: Publish to GitHub Packages
117
- run: |
118
- npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GIT_AUTH_TOKEN }}
119
- echo "//npm.pkg.github.com/:_authToken=${{ secrets.GIT_AUTH_TOKEN }}" > ~/.npmrc
120
- echo "@underpostnet:registry=https://npm.pkg.github.com" >> ~/.npmrc
121
- npm publish
122
129
  env:
123
130
  NODE_AUTH_TOKEN: ${{ secrets.GIT_AUTH_TOKEN }}
131
+ run: |
132
+ echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc
133
+ echo "@${{ github.repository_owner }}:registry=https://npm.pkg.github.com" >> ~/.npmrc
134
+ npm publish
@@ -17,7 +17,7 @@ concurrency:
17
17
 
18
18
  jobs:
19
19
  deploy:
20
- if: github.repository == 'underpostnet/pwa-microservices-template-ghpkg'
20
+ if: (github.repository == 'underpostnet/pwa-microservices-template-ghpkg' || github.repository == 'underpost/pwa-microservices-template-ghpkg')
21
21
  environment:
22
22
  name: github-pages
23
23
  url: ${{ steps.deployment.outputs.page_url }}
@@ -33,6 +33,8 @@ jobs:
33
33
  # run: git lfs checkout
34
34
 
35
35
  - name: Build the site
36
+ env:
37
+ GITHUB_USERNAME: ${{ github.repository_owner }}
36
38
  run: bash deploy/pwa-microservices-template/deploy.sh
37
39
  # git lfs install
38
40
  # git lfs track
@@ -44,7 +46,7 @@ jobs:
44
46
  uses: actions/upload-pages-artifact@v5
45
47
  with:
46
48
  # Upload entire repository
47
- path: './public/underpostnet.github.io/pwa-microservices-template-ghpkg/'
49
+ path: './public/${{ github.repository_owner }}.github.io/pwa-microservices-template-ghpkg/'
48
50
  - name: Deploy to GitHub Pages
49
51
  id: deployment
50
52
  uses: actions/deploy-pages@v5