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
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
push:
tags:
- 'v*'

permissions:
contents: read
id-token: write # npm provenance

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'

- name: Check tag matches package.json version
run: |
PKG_VERSION="v$(node -p 'require("./package.json").version')"
if [ "$PKG_VERSION" != "$GITHUB_REF_NAME" ]; then
echo "Tag $GITHUB_REF_NAME does not match package.json version $PKG_VERSION"
exit 1
fi

- name: Install dependencies
run: npm ci

# prepublishOnly runs lint, typecheck and build
- name: Publish
run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ JavaScript/TypeScript client library for the Application Distribution System API

## Installation

### From npm (when published)
### From npm

```bash
npm install @bindist/client
Expand All @@ -18,7 +18,8 @@ npm install @bindist/client
### From source

```bash
cd api/javascript
git clone https://github.com/BinDist/bindist-api-javascript.git
cd bindist-api-javascript
npm install
npm run build
```
Expand Down
29 changes: 23 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{
"name": "@bindist/client",
"version": "1.0.0",
"description": "Client library for the Application Distribution System API",
"description": "TypeScript/JavaScript client for the BinDist API",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"files": [
Expand All @@ -21,15 +26,24 @@
"build:browser": "tsup src/browser.ts --format iife --minify --outDir dist/browser",
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
"lint": "eslint src/",
"typecheck": "tsc --noEmit"
"typecheck": "tsc --noEmit",
"prepublishOnly": "npm run lint && npm run typecheck && npm run build"
},
"keywords": [
"bindist",
"api-client",
"distribution",
"application"
],
"author": "",
"author": "BinDist <dev@bindist.eu>",
"homepage": "https://docs.bindist.eu/sdks/javascript/",
"repository": {
"type": "git",
"url": "git+https://github.com/BinDist/bindist-api-javascript.git"
},
"bugs": {
"url": "https://github.com/BinDist/bindist-api-javascript/issues"
},
"license": "MIT",
"devDependencies": {
"@eslint/js": "^9.0.0",
Expand All @@ -41,5 +55,8 @@
},
"engines": {
"node": ">=18.0.0"
},
"publishConfig": {
"access": "public"
}
}
Loading