Skip to content

Commit

Permalink
feat: npm publish takes channel into consideration for a distribution…
Browse files Browse the repository at this point in the history
… tag
  • Loading branch information
markuczy committed Nov 29, 2024
1 parent 6dd0b41 commit 640c4fd
Show file tree
Hide file tree
Showing 15 changed files with 10 additions and 81 deletions.
6 changes: 0 additions & 6 deletions libs/accelerator/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@
"codeCoverage": true
}
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "accelerator"
}
}
},
"tags": []
Expand Down
6 changes: 0 additions & 6 deletions libs/angular-accelerator/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-accelerator"
}
},
"storybook": {
"executor": "@storybook/angular:start-storybook",
"options": {
Expand Down
6 changes: 0 additions & 6 deletions libs/angular-auth/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
"libs/angular-auth/package.json"
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "portal-integration-angular"
}
}
}
}
6 changes: 0 additions & 6 deletions libs/angular-integration-interface/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
"libs/angular-integration-interface/**/*.html"
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-integration-interface"
}
}
}
}
6 changes: 0 additions & 6 deletions libs/angular-remote-components/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
"libs/angular-remote-components/package.json"
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-remote-components"
}
}
}
}
6 changes: 0 additions & 6 deletions libs/angular-testing/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
"libs/angular-testing/**/*.html"
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-testing"
}
}
}
}
6 changes: 0 additions & 6 deletions libs/angular-webcomponents/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@
"libs/angular-webcomponents/**/*.html"
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "angular-webcomponents"
}
}
}
}
6 changes: 0 additions & 6 deletions libs/integration-interface/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@
"codeCoverage": true
}
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "integration-interface"
}
}
},
"tags": []
Expand Down
6 changes: 0 additions & 6 deletions libs/keycloak-auth/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
"libs/keycloak-auth/package.json"
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "portal-integration-angular"
}
}
}
}
6 changes: 0 additions & 6 deletions libs/ngrx-accelerator/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@
"options": {
"lintFilePatterns": ["libs/ngrx-accelerator/**/*.ts", "libs/ngrx-accelerator/package.json"]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "ngrx-accelerator"
}
}
}
}
6 changes: 0 additions & 6 deletions libs/portal-integration-angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "portal-integration-angular"
}
},
"copy-additional-styles": {
"executor": "nx:run-commands",
"options": {
Expand Down
8 changes: 1 addition & 7 deletions libs/portal-layout-styles/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,7 @@
"options": {
"lintFilePatterns": ["libs/portal-layout-styles/**/*.ts", "libs/portal-layout-styles/package.json"]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "portal-layout-styles"
}
},
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
Expand Down
6 changes: 0 additions & 6 deletions libs/shell-core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@
"libs/shell-core/package.json"
]
}
},
"release": {
"executor": "nx-release:build-update-publish",
"options": {
"libName": "shell-core"
}
}
}
}
9 changes: 8 additions & 1 deletion release-script.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/bin/bash
echo "$1"
echo "$2"
export VERSION=$1
channel=$2
registry="registry.npmjs.org"
packageJsonData=$(cat package.json)
topLevelPackageVersion=$(echo "$packageJsonData" | jq -r '.version')
if [[ $topLevelPackageVersion != $1 ]]
Expand All @@ -14,15 +17,19 @@ while IFS= read -r folder; do
folder_names+=("$folder")
done < <(find "$directory" -mindepth 1 -maxdepth 1 -type d | awk -F "/" '{print $NF}' | sort | uniq)

wd=$(pwd)
for folder in "${folder_names[@]}"; do
cd $wd
packageJsonDataLib=$(cat libs/$folder/package.json)
libPackageVersion=$(echo "$packageJsonDataLib" | jq -r '.version')
packageJsonDataLib=$(echo "$packageJsonDataLib" | sed -E 's/(@onecx[^"]+?": *?")([^"]+)"/\1^'$1'"/')
echo $packageJsonDataLib > libs/$folder/package.json
if [[ $libPackageVersion != $1 ]]
then
npx -p replace-json-property rjp libs/$folder/package.json version $1
npx nx run $folder:release
npx nx build --project $folder
cd ./dist/libs/$folder
echo //$registry/:_authToken=$NPM_TOKEN >> .npmrc && npm publish --dry-run --tag=$channel
fi
done

Expand Down
2 changes: 1 addition & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
[
'@semantic-release/exec',
{
prepareCmd: `./release-script.sh \${nextRelease.version}`,
prepareCmd: `./release-script.sh \${nextRelease.version} \${nextRelease.channel}`,
},
],
[
Expand Down

0 comments on commit 640c4fd

Please sign in to comment.