From b7fd16b5a1984f31b86f6ca011fa0103ab789d8d Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Fri, 8 Mar 2024 16:19:18 +0000 Subject: [PATCH] ci(cd): standardise @fdawgs cd workflows --- .github/workflows/cd.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a0536b9..2ab2e2e 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -53,11 +53,11 @@ jobs: - name: Publish to NPM env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - # Build docs and TS definitions, and remove dev values + # Build docs/definitions, and remove dev values # from package.json before publishing to reduce package size run: | npm i --ignore-scripts - npm run build + npm run build --if-present npm pkg delete commitlint devDependencies jest scripts npm publish --access public --ignore-scripts --provenance @@ -66,6 +66,7 @@ jobs: needs: release if: needs.release.outputs.release_created == 'true' runs-on: ubuntu-latest + environment: main permissions: contents: read id-token: write @@ -85,16 +86,16 @@ jobs: - name: Scope package run: | - pkgName=$(npm pkg get name | tr -d '"') + pkgName=$(node -p "require('./package.json').name") npm pkg set name="@fdawgs/$pkgName" - name: Publish to GitHub Packages env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # Build docs and TS definitions, and remove dev values + # Build docs/definitions, and remove dev values # from package.json before publishing to reduce package size run: | npm i --ignore-scripts - npm run build + npm run build --if-present npm pkg delete commitlint devDependencies jest scripts npm publish --access public --ignore-scripts --provenance