From 5ea3bdd441a58a96c4ac274f10ea74ffe1faa088 Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 17 Jan 2025 15:51:44 +0000 Subject: [PATCH] test new npmPublish --- .github/workflows/npmpublish.yml | 23 ++++++++++++++++++----- package.json | 3 +-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 5bfd65e09..5cdb4a991 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -15,6 +15,7 @@ on: jobs: build: + if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -26,9 +27,8 @@ jobs: - run: yarn test:audit - run: yarn lint - run: yarn build - - run: yarn test - name: Create code coverage report - run: yarn test:coverage + run: yarn test - name: Change Report Path run: sed -i 's+/home/runner/work/ccd-case-ui-toolkit/ccd-case-ui-toolkit+/github/workspace+g' coverage/ccd-case-ui-toolkit/lcov.info - name: Archive code coverage results @@ -37,7 +37,20 @@ jobs: name: code-coverage-report path: coverage + release-build: + if: startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 18 + - run: corepack enable && yarn --version + - run: yarn install + - run: yarn build + sonarcloud: + if: github.event_name != 'push' || !startsWith(github.ref, 'refs/tags') needs: build name: SonarCloud Trigger runs-on: ubuntu-latest @@ -68,7 +81,7 @@ jobs: publish-npm: if: startsWith(github.ref, 'refs/tags') - needs: sonarcloud + needs: release-build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -86,7 +99,7 @@ jobs: publish-gpr: if: startsWith(github.ref, 'refs/tags') - needs: sonarcloud + needs: release-build runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -101,4 +114,4 @@ jobs: - run: npm publish dist/ccd-case-ui-toolkit/ --ignore-scripts env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_PUBLISH_REGISTRY: https://npm.pkg.github.com/ + NPM_PUBLISH_REGISTRY: https://npm.pkg.github.com/ \ No newline at end of file diff --git a/package.json b/package.json index d883f5df5..3cac1bf4b 100644 --- a/package.json +++ b/package.json @@ -36,9 +36,8 @@ "prebuild:watch": "rimraf dist tmp", "preversion": "npm run ci", "build:ng:test": "ng build", - "test": "ng test ccd-case-ui-toolkit-lib --code-coverage", + "test": "ng test ccd-case-ui-toolkit-lib --code-coverage", "test:codacy-upload": "echo `cat ./coverage/ccd-case-ui-toolkit/lcov-report/lcov.info | codacy-coverage`", - "test:coverage": "ng test ccd-case-ui-toolkit-lib --code-coverage", "test:watch": "ng test ccd-case-ui-toolkit-lib --code-coverage --watch=true", "test:audit": "./bin/run-yarn-audit.sh -f yarn-audit-known-issues", "tslint": "tslint",