From 40cd804f32abe4d569da0ab44a0a657e1b89e2e1 Mon Sep 17 00:00:00 2001 From: eksrha <58111764+eksrha@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:12:11 +0100 Subject: [PATCH 1/3] test publish on pr --- .github/workflows/pull-request.yml | 12 ++++++------ package.json | 4 ++-- projects/ng-mat-components/package.json | 4 ++-- tsconfig.json | 11 ++++++++--- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 2566193..89df88e 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: '16.x' - registry-url: 'https://npm.pkg.github.com' + registry-url: 'https://registry.npmjs.org/' scope: '@fullstack-devops' - name: install packages @@ -28,8 +28,8 @@ jobs: - name: build applikation run: yarn run build - # - name: yarn publish - # working-directory: dist/ng-mat-components - # run: yarn publish --access public --new-version ${{ needs.generate_infos.outputs.version }} --no-git-tag-version - # env: - # NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: yarn publish + working-directory: dist/ng-mat-components + run: yarn publish --access public --new-version ${{ needs.generate_infos.outputs.version }} --no-git-tag-version + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} diff --git a/package.json b/package.json index 0d12db6..a2b6673 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@fullstack-devops/ng-mat-components", - "version": "0.0.0", + "version": "0.0.0-PLACEHOLDER", "engines": { "node": ">=14.0.0 <17.0.0", "yarn": "^1.22.17", @@ -20,7 +20,7 @@ "format": "prettier --write .", "lint": "ng lint" }, - "private": true, + "private": false, "dependencies": { "@angular/animations": "~13.3.11", "@angular/cdk": "13.3.9", diff --git a/projects/ng-mat-components/package.json b/projects/ng-mat-components/package.json index d3fd384..22a3784 100644 --- a/projects/ng-mat-components/package.json +++ b/projects/ng-mat-components/package.json @@ -1,9 +1,9 @@ { "name": "@fullstack-devops/ng-mat-components", - "version": "0.0.0", + "version": "0.0.0-PLACEHOLDER", "license": "Apache-2.0", "publishConfig": { - "registry": "https://registry.npmjs.org/@fullstack-devops" + "@fullstack-devops:registry": "https://registry.npmjs.org/" }, "peerDependencies": { "@angular/common": "^13.0.0", diff --git a/tsconfig.json b/tsconfig.json index 6d47bba..045ceae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,9 @@ "noFallthroughCasesInSwitch": true, "sourceMap": true, "paths": { - "ng-mat-components": ["dist/ng-mat-components/ng-mat-components", "dist/ng-mat-components"] + "ng-mat-components": [ + "dist/ng-mat-components" + ] }, "declaration": false, "downlevelIteration": true, @@ -21,7 +23,10 @@ "importHelpers": true, "target": "es2017", "module": "es2020", - "lib": ["es2020", "dom"] + "lib": [ + "es2020", + "dom" + ] }, "angularCompilerOptions": { "enableI18nLegacyMessageIdFormat": false, @@ -29,4 +34,4 @@ "strictInputAccessModifiers": true, "strictTemplates": true } -} +} \ No newline at end of file From 8b02f4d2279ffd75a3446532921814a20ab557f8 Mon Sep 17 00:00:00 2001 From: eksrha <58111764+eksrha@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:26:50 +0100 Subject: [PATCH 2/3] change token --- .github/workflows/pull-request.yml | 6 +++--- .github/workflows/release.yml | 25 ++++++++++++++----------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 89df88e..70de378 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: '16.x' - registry-url: 'https://registry.npmjs.org/' + registry-url: 'https://npm.pkg.github.com' scope: '@fullstack-devops' - name: install packages @@ -28,8 +28,8 @@ jobs: - name: build applikation run: yarn run build - - name: yarn publish + - name: npm publish to GitHub working-directory: dist/ng-mat-components run: yarn publish --access public --new-version ${{ needs.generate_infos.outputs.version }} --no-git-tag-version env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b56a07..f744c1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Setup node for GitHub + - name: Setup node for npmjs uses: actions/setup-node@v3 with: node-version: '16.x' @@ -35,19 +35,22 @@ jobs: - name: build applikation run: yarn run build - - name: yarn publish + - name: yarn publish to npmjs working-directory: dist/ng-mat-components - run: | - npm version ${{ needs.create_release.outputs.version }} - npm set registry https://registry.npmjs.org/@fullstack-devops - npm publish + run: yarn publish --access public --new-version ${{ needs.create_release.outputs.version }} --no-git-tag-version env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }} + + - name: Setup node for GitHub + uses: actions/setup-node@v3 + with: + registry-url: 'https://npm.pkg.github.com' + - name: yarn publish to GitHub + working-directory: dist/ng-mat-components + run: yarn publish --access public --new-version ${{ needs.create_release.outputs.version }} --no-git-tag-version + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish_gh_release: - runs-on: ubuntu-latest - needs: build - steps: - name: Publish release run: awesome-ci release publish --release-id "${{ needs.create_release.outputs.release-id }}" env: From c4064239149ab5a4b6ac71982cab9fa2d5d07bb4 Mon Sep 17 00:00:00 2001 From: eksrha <58111764+eksrha@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:26:50 +0100 Subject: [PATCH 3/3] change token --- .github/workflows/pull-request.yml | 6 +++--- .github/workflows/release.yml | 25 ++++++++++++++----------- projects/ng-mat-components/package.json | 3 --- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 89df88e..70de378 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -20,7 +20,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: '16.x' - registry-url: 'https://registry.npmjs.org/' + registry-url: 'https://npm.pkg.github.com' scope: '@fullstack-devops' - name: install packages @@ -28,8 +28,8 @@ jobs: - name: build applikation run: yarn run build - - name: yarn publish + - name: npm publish to GitHub working-directory: dist/ng-mat-components run: yarn publish --access public --new-version ${{ needs.generate_infos.outputs.version }} --no-git-tag-version env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b56a07..f744c1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Setup node for GitHub + - name: Setup node for npmjs uses: actions/setup-node@v3 with: node-version: '16.x' @@ -35,19 +35,22 @@ jobs: - name: build applikation run: yarn run build - - name: yarn publish + - name: yarn publish to npmjs working-directory: dist/ng-mat-components - run: | - npm version ${{ needs.create_release.outputs.version }} - npm set registry https://registry.npmjs.org/@fullstack-devops - npm publish + run: yarn publish --access public --new-version ${{ needs.create_release.outputs.version }} --no-git-tag-version env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }} + + - name: Setup node for GitHub + uses: actions/setup-node@v3 + with: + registry-url: 'https://npm.pkg.github.com' + - name: yarn publish to GitHub + working-directory: dist/ng-mat-components + run: yarn publish --access public --new-version ${{ needs.create_release.outputs.version }} --no-git-tag-version + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish_gh_release: - runs-on: ubuntu-latest - needs: build - steps: - name: Publish release run: awesome-ci release publish --release-id "${{ needs.create_release.outputs.release-id }}" env: diff --git a/projects/ng-mat-components/package.json b/projects/ng-mat-components/package.json index 22a3784..99821d4 100644 --- a/projects/ng-mat-components/package.json +++ b/projects/ng-mat-components/package.json @@ -2,9 +2,6 @@ "name": "@fullstack-devops/ng-mat-components", "version": "0.0.0-PLACEHOLDER", "license": "Apache-2.0", - "publishConfig": { - "@fullstack-devops:registry": "https://registry.npmjs.org/" - }, "peerDependencies": { "@angular/common": "^13.0.0", "@angular/core": "^13.0.0",