Skip to content

Commit

Permalink
ci(cd): standardise @Fdawgs cd workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Mar 8, 2024
1 parent bc3f03f commit d6ed4ea
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ jobs:
- name: Publish to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Remove dev values from package.json before publishing to reduce package size
# Build docs/definitions, and remove dev values
# from package.json before publishing to reduce package size
run: |
npm i --ignore-scripts
npm run build --if-present
npm pkg delete commitlint devDependencies jest scripts
npm publish --access public --ignore-scripts --provenance
Expand All @@ -63,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
Expand All @@ -82,13 +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 }}
# Remove dev values from package.json before publishing to reduce package size
# Build docs/definitions, and remove dev values
# from package.json before publishing to reduce package size
run: |
npm i --ignore-scripts
npm run build --if-present
npm pkg delete commitlint devDependencies jest scripts
npm publish --access public --ignore-scripts --provenance

0 comments on commit d6ed4ea

Please sign in to comment.