diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0a020b2047..e49757d85f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,8 +63,6 @@ env: DOCKER_REPOSITORY_PASSWORD: ${{ secrets.DOCKER_REPOSITORY_PASSWORD }} DOCKER_REPOSITORY_STORYBOOK: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/storybook" DOCKER_REPOSITORY: "${{ secrets.DOCKER_REPOSITORY_DOMAIN }}/alfresco/demo-shell" - NPM_REGISTRY_ADDRESS: ${{ secrets.NPM_REGISTRY_ADDRESS }} - NPM_REGISTRY_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} REPO_OWNER: "Alfresco" REPO_NAME: "alfresco-ng2-components" @@ -195,8 +193,24 @@ jobs: ./scripts/github/build/bumpversion.sh nx affected:build $NX_CALCULATION_FLAGS --prod --exclude="demoshell" --skip-nx-cache nx affected $NX_CALCULATION_FLAGS --target=pretheme - - name: release libraries - run: ./scripts/github/release/release-npm.sh ${{ steps.set-dryrun.outputs.dryrun }} + - uses: actions/setup-node@v3 + name: release libraries GH registry + with: + node-version: 14 + registry-url: 'https://npm.pkg.github.com' + scope: '@alfresco' + - run: nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM -- --access restricted || exit 1 + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/setup-node@v3 + name: release libraries Npm registry + with: + node-version: 14 + registry-url: 'https://${{ vars.NPM_REGISTRY_ADDRESS }}' + scope: '@alfresco' + - run: nx affected --target=npm-publish $NX_CALCULATION_FLAGS --tag=$TAG_NPM || exit 1 + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_TOKEN }} npm-check-bundle: needs: [release-npm] diff --git a/angular.json b/angular.json index 532816f495..056cf71dd4 100644 --- a/angular.json +++ b/angular.json @@ -429,6 +429,21 @@ } ] } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/core", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, @@ -532,6 +547,21 @@ } ] } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/content-services", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, @@ -601,6 +631,21 @@ } ] } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/process-services", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, @@ -715,6 +760,21 @@ } ] } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/process-services-cloud", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, @@ -774,6 +834,21 @@ } ] } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/insights", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, @@ -823,6 +898,21 @@ } ] } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/extensions", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, @@ -894,6 +984,21 @@ "target": "build" } ] + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/extensions", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, @@ -953,6 +1058,21 @@ "lib/cli/**/*.html" ] } + }, + "npm-publish": { + "executor": "nx:run-commands", + "dependsOn": [ + "build" + ], + "options": { + "cwd": "dist/libs/cli", + "commands": [ + { + "command": "npm publish --tag {args.tag}", + "forwardAllArgs": true + } + ] + } } } }, diff --git a/scripts/github/release/release-npm.sh b/scripts/github/release/release-npm.sh deleted file mode 100755 index d4a39bb4c8..0000000000 --- a/scripts/github/release/release-npm.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -cd $DIR/../../../ - -VERSION_IN_PACKAGE_JSON=`node -p "require('./package.json')".version;`; -BRANCH=${GITHUB_REF##*/} -#BRANCH=${GITHUB_BASE_REF} -if [[ $BRANCH =~ ^master(-patch.*)?$ ]] -then - # Pre-release versions - if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]]; - then - TAG_NPM=next - # Stable major versions - else - TAG_NPM=latest - fi -fi - -if [[ $BRANCH =~ ^develop(-patch.*)?$ ]] -then - TAG_NPM=alpha -fi - -echo "Publishing on Public npm registry with tag $TAG_NPM" -./node_modules/@alfresco/adf-cli/bin/adf-cli npm-publish \ - --npmRegistry $NPM_REGISTRY_ADDRESS \ - --tokenRegistry $NPM_REGISTRY_TOKEN \ - --tag $TAG_NPM \ - --pathProject "$(pwd)" \ - "$@"