Skip to content

Commit

Permalink
Merge pull request #4 from web-illinois/jonker/add_npm_workflow
Browse files Browse the repository at this point in the history
Create publish_npm.yml
  • Loading branch information
bryanjonker-illinois authored Aug 21, 2024
2 parents 40a0dcc + 1e001c6 commit 8d3ae4d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: publish_npm
on:
workflow_dispatch:
push:
tags: [ '**' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.TOOLKIT_NPM_SECRET}}
13 changes: 11 additions & 2 deletions template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,24 @@
"license": "MIT",
"version": "0.0.1",
"type": "module",
"files": [
"src/**",
"dist/**",
"builder/**"
],
"exports": {
".": {
"import": "./src/<%= name %>.js"
"import": "./src/<%= name %>.js",
"require": "./dist/<%= name %>.cjs",
"default": "./dist/<%= name %>.js"
}
},
"main":"./dist/<%= name %>.js",
"scripts": {
"dev": "vite",
"build": "vite build --config vite.build.config.js --emptyOutDir",
"preview": "vite preview"
"preview": "vite preview",
"prepack": "npm run build"
},
"dependencies": {
"lit": "3.1.3"
Expand Down

0 comments on commit 8d3ae4d

Please sign in to comment.