Skip to content

Commit

Permalink
chore: switch to pnpm and add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw committed Jan 10, 2024
1 parent b275890 commit 460846d
Show file tree
Hide file tree
Showing 8 changed files with 2,597 additions and 4,313 deletions.
17 changes: 0 additions & 17 deletions .github/actions/test/action.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches:
- main
paths:
- 'src/**'
- 'test/**'
pull_request:
branches:
- main
paths:
- 'src/**'
- 'test/**'
- '.github/workflows/ci.yml'
workflow_dispatch:

jobs:
test:
name: Test
strategy:
matrix:
node-version:
- 18
- 20
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- run: pnpm install
- name: Test
run: pnpm run test
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: node
bump-minor-pre-major: true
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 'latest'
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v2
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'pnpm'
if: ${{ steps.release.outputs.release_created }}
- name: Install dependencies
run: pnpm install
if: ${{ steps.release.outputs.release_created }}
- name: Publish
run: pnpm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
16 changes: 0 additions & 16 deletions .github/workflows/test.yml

This file was deleted.

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pail

[![Test](https://github.com/alanshaw/pail/actions/workflows/test.yml/badge.svg)](https://github.com/alanshaw/pail/actions/workflows/test.yml)
[![Test](https://github.com/web3-storage/pail/actions/workflows/ci.yml/badge.svg)](https://github.com/web3-storage/pail/actions/workflows/ci.yml)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

DAG based key value store. Sharded DAG that minimises traversals and work to build shards.
Expand All @@ -11,15 +11,15 @@ DAG based key value store. Sharded DAG that minimises traversals and work to bui
## Install

```
npm install @alanshaw/pail
npm install @web3-storage/pail
```

## Usage

```js
import { put, get, del } from '@alanshaw/pail'
import { ShardBlock } from '@alanshaw/pail/shard'
import { MemoryBlockstore } from '@alanshaw/pail/block'
import { put, get, del } from '@web3-storage/pail'
import { ShardBlock } from '@web3-storage/pail/shard'
import { MemoryBlockstore } from '@web3-storage/pail/block'

// Initialize a new bucket
const blocks = new MemoryBlockstore()
Expand All @@ -45,10 +45,10 @@ for (const block of removals) {
If adding many multiple items to the pail together, it is faster to batch them together.

```js
import { put, get, del } from '@alanshaw/pail'
import { ShardBlock } from '@alanshaw/pail/shard'
import { MemoryBlockstore } from '@alanshaw/pail/block'
import * as Batch from '@alanshaw/pail/batch'
import { put, get, del } from '@web3-storage/pail'
import { ShardBlock } from '@web3-storage/pail/shard'
import { MemoryBlockstore } from '@web3-storage/pail/block'
import * as Batch from '@web3-storage/pail/batch'

// Initialize a new bucket
const blocks = new MemoryBlockstore()
Expand Down Expand Up @@ -77,8 +77,8 @@ for (const block of removals) {

## Contributing

Feel free to join in. All welcome. [Open an issue](https://github.com/alanshaw/pail/issues)!
Feel free to join in. All welcome. [Open an issue](https://github.com/web3-storage/pail/issues)!

## License

Dual-licensed under [MIT or Apache 2.0](https://github.com/alanshaw/pail/blob/main/LICENSE.md)
Dual-licensed under [MIT or Apache 2.0](https://github.com/web3-storage/pail/blob/main/LICENSE.md)
Loading

0 comments on commit 460846d

Please sign in to comment.