Skip to content

Commit

Permalink
Changed to using package.json files
Browse files Browse the repository at this point in the history
Reuse Github workflows from core
  • Loading branch information
james-pre committed May 29, 2024
1 parent 54dd441 commit ada7f90
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 97 deletions.
67 changes: 1 addition & 66 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,7 @@ on:

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }}
uses: zen-fs/core/.github/workflows/ci.yaml
permissions:
contents: read
id-token: write
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Formatting
run: npm run format:check

- name: Linting
run: npm run lint

#- name: Unit tests
# run: npm run test

- name: Build
run: npm run build
docs:
needs: ci
runs-on: ubuntu-latest
name: Docs build and deploy
permissions:
contents: write
id-token: write
pages: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Build docs
run: npm run build:docs

- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
with:
path: ./docs
- name: 'Deploy docs'
id: deploy
if: github.event_name != 'pull_request'
uses: actions/deploy-pages@v4
27 changes: 3 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,9 @@ on:

jobs:
ci:
uses: ./.github/workflows/ci.yaml
uses: zen-fs/core/.github/workflows/ci.yaml
permissions:
contents: write
contents: read
id-token: write
pages: write
release:
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup npm authenication
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
uses: zen-fs/core/.github/workflows/release.yaml
1 change: 0 additions & 1 deletion .npmignore

This file was deleted.

19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
"description": "DOM backends for ZenFS",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"keywords": [
"filesystem",
"node",
"storage"
],
"type": "module",
"homepage": "https://github.com/zen-fs/dom",
"author": "James P. <[email protected]>",
Expand All @@ -20,6 +15,12 @@
"bugs": {
"url": "https://github.com/zen-fs/dom/issues"
},
"files": [
"dist",
"src",
"license.md",
"tsconfig.json"
],
"engines": {
"node": ">= 18"
},
Expand All @@ -33,6 +34,7 @@
"lint": "tsc -p tsconfig.json --noEmit && eslint src",
"build": "npx build --package=@zenfs/core --globalName ZenFS_DOM --entry src/index.ts",
"build:docs": "typedoc --out docs --name 'ZenFS DOM' src/index.ts",
"test": "echo No tests yet",
"prepublishOnly": "npm run build"
},
"devDependencies": {
Expand All @@ -47,5 +49,10 @@
},
"peerDependencies": {
"@zenfs/core": "^0.12.5"
}
},
"keywords": [
"filesystem",
"node",
"storage"
]
}

0 comments on commit ada7f90

Please sign in to comment.