Skip to content

Commit

Permalink
test new npmPublish
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-HMCTS committed Jan 17, 2025
1 parent 6a2f0d7 commit 5ea3bdd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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/
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 5ea3bdd

Please sign in to comment.