Fix again
Some checks failed
Generate and Release Protos / release (push) Failing after 22s

This commit is contained in:
2026-01-07 18:28:34 +00:00
parent 20cb7b101c
commit c8731caadd

View File

@@ -38,39 +38,36 @@ jobs:
- name: Build and Publish TS
working-directory: gen/ts
run: |
# 1. Initialize with defaults
npm init -y
# 2. Build index.ts carefully
# We ensure a space before 'from' and explicit double quotes around the path
Build index.ts - STRIPPING HYPHENS AND UNDERSCORES
echo "// Auto-generated" > index.ts
find . -maxdepth 1 -name "*.ts" -not -name "index.ts" | sed 's|^\./||; s|\.ts$||' | awk '{
# Create Namespace: split by underscore, capitalize each part
n = split($0, parts, "_");
# Use gsub to turn hyphens into underscores so we can split easily
clean = $0;
gsub(/-/, "_", clean);
n = split(clean, parts, "_");
name = "";
for (i=1; i<=n; i++) {
if (length(parts[i]) > 0) {
name = name toupper(substr(parts[i],1,1)) substr(parts[i],2);
}
# CRITICAL: Space before from, escaped quotes around path
}
# name will now be 'DataIngressPisData' (valid TS)
printf "export * as %s from \"./%s.js\";\n", name, $0
}' >> index.ts
# 3. Debug: Print index.ts so we can see it in logs if it fails again
cat index.ts
# 4. Update package.json using a robust jq call
# We use --arg to ensure the VERSION string doesn't break the JSON
VERSION="${{ steps.get_version.outputs.VERSION }}"
jq --arg ver "$VERSION" \
--arg name "@owlboard/backend-data-contracts" \
'.name = $name | .version = $ver | .type = "module" | .main = "./dist/index.js" | .types = "./dist/index.d.ts"' \
package.json > package.json.tmp && mv package.json.tmp package.json
package.json > package.json.new && mv package.json.new package.json
# 5. Compile with explicit flags
# We use 'nodenext' because it matches the .js extensions in our index.ts
# Compile
npx tsc index.ts --declaration --module nodenext --target es2022 --moduleResolution nodenext --outDir dist/ --skipLibCheck true
# 6. Authenticate and Publish
# Publish
npm config set //git.fjla.uk/api/packages/owlboard/npm/:_authToken ${{ secrets.PACKAGE_PUSH }}
npm publish