Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
imcotton committed Jul 30, 2024
1 parent 9256417 commit 97ad9f5
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/bun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Bundle

on: push

jobs:

publish:

runs-on: ubuntu-latest
timeout-minutes: 3

permissions:
contents: read
id-token: write

steps:

- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: preBuild
run: |-
mkdir ./dist
bun install
- name: Build
run: bun build ./src/bin.ts
--target node
--format esm
--outdir ./dist
--entry-naming [name]-[hash].mjs

- name: Build min
run: bun build ./src/bin.ts
--target node
--format esm
--outdir ./dist
--entry-naming [name]-[hash].min.mjs
--minify

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: key-gen-${{ hashFiles('./dist/*') }}
path: ./dist

7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "at-key-gen-ssh-ed25519",
"version": "1.0.0",
"dependencies": {
"micro-key-producer": "~0.7.0"
}
}
39 changes: 39 additions & 0 deletions src/bin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { main } from './main.ts';

import { args, webcrypto } from './utils.ts';





async function run () {

const [ x, ...xs ] = args;

if (x === 'uuid') {
return console.log(webcrypto.randomUUID());
}

const { publicKey, privateKey, fingerprint } = await main(xs);

if (x === 'pub' || x === 'public') {

console.log(publicKey);

} else if (x === 'private') {

console.log(privateKey);

} else if (x === 'fingerprint') {

console.log(fingerprint);

}

throw new Error(`unknown - ${ x }`);

}

run();


0 comments on commit 97ad9f5

Please sign in to comment.