Skip to content

Commit

Permalink
CI - Include tests in publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
smastrom committed Oct 18, 2023
1 parent 405e87a commit e439b5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Publish to NPM

on:
release:
types: [created]
push:
tags: ['v*']

jobs:
tests-workflow:
uses: ./.github/workflows/tests.yml
publish:
needs: tests-workflow
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -22,10 +25,12 @@ jobs:
version: 8
run_install: true
- name: Build Notivue
run: pnpm -C packages/notivue run build
# The 'postbuild' command deletes any existing tarball, packs a new one,
# and verifies it (presence of all expected files and no debug statements in the code).
- name: Publish Notivue
run: cd packages/notivue && npm publish *.tgz --provenance
run: cd packages/notivue && pnpm build
# Delete any existing tarball, pack a new one, and verify the presence
# of all expected files and no debug statements in the code.
- name: Pack and verify
run: rm -rf *.tgz && npm pack && ./scripts/verify-tarball.sh
- name: Publish
run: npm publish *.tgz --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion packages/notivue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"scripts": {
"prebuild": "cp ../../README.md ../../LICENSE .",
"build": "rm -rf dist && vue-tsc && vite build && pnpm build:css",
"postbuild": " rm -f *.tgz && npm pack && ./scripts/verify-tarball.sh",
"postbuild": "rm -rf *.tgz && npm pack && ./scripts/verify-tarball.sh",
"build:css": "esbuild ./Notifications/notifications.css ./core/animations.css --bundle --outdir=dist --minify --target=chrome58,edge16,firefox57,node12,safari11",
"watch": "rm -rf dist && concurrently \"vite build --watch\" \"pnpm build:css --watch\""
},
Expand Down

0 comments on commit e439b5d

Please sign in to comment.