Skip to content

Commit

Permalink
Added a GitHub Actions workflow that publishes to NPM when a new tag …
Browse files Browse the repository at this point in the history
…is created.
  • Loading branch information
prjctimg committed Oct 7, 2023
1 parent 25241de commit 22916f4
Show file tree
Hide file tree
Showing 21 changed files with 228 additions and 2,466 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and publish to NPM

on:
push:
tags: ['v*']

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install development dependencies
run: npm ci

- name: Build bundle
run: npm run build

- name: Build types
- run: npm run types

- name: Publish to NPM
env:
NPM_TOKEN: ${{ secrets.NPM_PUBLISH }}
run: npm publish --tag latest
19 changes: 14 additions & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Program",
"program": "${workspaceFolder}/app.js",
"name": "ts-node",
"type": "node",
"request": "launch",
"skipFiles": [
"<node_internals>/**"
"runtimeExecutable": "node",
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register/transpile-only"
],
"type": "node"
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
"skipFiles": [
"<node_internals>/**",
"node_modules/**"
]
}
]
}
12 changes: 2 additions & 10 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { formatHex, formatHex8 } from "culori"
import {
getFarthestLightness,
getNearestLightness,
minLightness,
maxLightness,
} from "./dist/huetiful.esm.mjs"
import { discoverPalettes } from "./dist/huetiful.esm.mjs"

let sample = [
"#00ffdc",
Expand All @@ -20,7 +15,4 @@ let sample = [
"#720000",
]

console.log(getFarthestLightness("brown", sample))
console.log(getNearestLightness("brown", sample))
console.log(minLightness(sample))
console.log(maxLightness(sample))
console.log(discoverPalettes(sample))
9 changes: 0 additions & 9 deletions docs/content/pages/about-types.md

This file was deleted.

80 changes: 0 additions & 80 deletions docs/content/pages/achromatic.md

This file was deleted.

Loading

0 comments on commit 22916f4

Please sign in to comment.