Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,30 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci

- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
with:
publish: npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Set up Node.js for GitHub Packages publishing
if: steps.changesets.outputs.published == 'true'
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://npm.pkg.github.com"
scope: "@aokiapp"

- name: Publish to GitHub Packages
if: steps.changesets.outputs.published == 'true'
run: npm run build && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,35 @@ Tag-Length-Value (TLV) parser and builder library with schema support. Provides

## Installation

### From npm

```bash
npm install @aokiapp/tlv
```

### From GitHub Packages

**Note**: GitHub Packages requires authentication even for public packages.

First, authenticate with GitHub:

```bash
npm login --registry=https://npm.pkg.github.com
```

Then install:

```bash
npm install @aokiapp/tlv --registry=https://npm.pkg.github.com
```

Or configure your `.npmrc`:

```
@aokiapp:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
```

## Quick Start

### Basic TLV Parsing
Expand Down Expand Up @@ -527,12 +552,19 @@ npm run format # Prettier

### Release

This library is automatically published to both npm and GitHub Packages via GitHub Actions.

```bash
npm run changelog # Create changeset
npm run version # Update version
npm run publish # Publish to npm
npm run publish # Publish manually (for testing, otherwise use GitHub Actions)
```

When changes are pushed to the `main` branch with a changeset, the GitHub Actions workflow will:

1. Create a release PR or publish to npm
2. Automatically publish to GitHub Packages if npm publish succeeds

## Project Structure

```
Expand Down
7 changes: 1 addition & 6 deletions vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,7 @@ export default defineConfig({
provider: "istanbul",
reporter: ["text", "text-summary"],
include: ["src/**/*.ts"],
exclude: [
"tests/**",
"examples/**",
".changeset/**",
"**/*.d.ts",
],
exclude: ["tests/**", "examples/**", ".changeset/**", "**/*.d.ts"],
},
},
});