Skip to content

Commit

Permalink
Add hpke/dhkem-x25519.
Browse files Browse the repository at this point in the history
  • Loading branch information
dajiaji committed Jul 28, 2023
1 parent 89d699f commit 25ca293
Show file tree
Hide file tree
Showing 26 changed files with 1,010 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/dhkem-x25519
working-directory: ./x/dhkem-x25519
run: |
deno fmt --check
deno task test
- name: Run deno test for /x/dhkem-secp256k1
working-directory: ./x/dhkem-secp256k1
run: |
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/ci_browser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ jobs:
deno task minify > test/runtimes/browsers/pages/src/hpke.js
mkdir test/runtimes/browsers/pages/core
cp -rf core/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/core
mkdir test/runtimes/browsers/pages/dhkem-x25519
cp -rf x/dhkem-x25519/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-x25519
mkdir test/runtimes/browsers/pages/dhkem-secp256k1
cp -rf x/dhkem-secp256k1/test/runtimes/browsers/pages/* test/runtimes/browsers/pages/dhkem-secp256k1
deno task minify > test/runtimes/browsers/pages/dhkem-secp256k1/src/hpke.js
- working-directory: ./core
run: |
deno task dnt
deno task minify > ../test/runtimes/browsers/pages/core/src/hpke-core.js
deno task minify > ../test/runtimes/browsers/pages/dhkem-x25519/src/hpke-core.js
- working-directory: ./x/dhkem-x25519
run: |
deno task dnt
deno task minify > ../../test/runtimes/browsers/pages/dhkem-x25519/src/hpke-dhkem-x25519.js
- working-directory: ./x/dhkem-secp256k1
run: |
deno task dnt
Expand All @@ -56,5 +63,7 @@ jobs:
npx playwright test
- working-directory: ./core/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/dhkem-x25519/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
- working-directory: ./x/dhkem-secp256k1/test/runtimes/browsers
run: npm install && npx playwright install && npx playwright test
13 changes: 12 additions & 1 deletion .github/workflows/ci_bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,27 @@ jobs:
nohup bun src/index.js &
sleep 3
deno test hpke.spec.ts --allow-net
- working-directory: ./core/
- working-directory: ./core
run: |
deno task dnt
deno task minify > test/runtimes/hpke-core.js
deno task minify > ../x/dhkem-x25519/test/runtimes/hpke-core.js
- name: Run test for core
working-directory: ./core/test/runtimes/bun
run: |
nohup bun src/index.js &
sleep 3
deno test core.spec.ts --allow-net
- working-directory: ./x/dhkem-x25519
run: |
deno task dnt
deno task minify > test/runtimes/hpke-dhke-x25519.js
- name: Run test for dhkem-x25519
working-directory: ./x/dhkem-x25519/test/runtimes/bun
run: |
nohup bun src/index.js &
sleep 3
deno test dhkem-x25519.spec.ts --allow-net
- working-directory: ./x/dhkem-secp256k1/
run: |
deno task dnt
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/ci_cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
npm install -g esbuild
deno task dnt
deno task minify > test/runtimes/hpke.js
deno task minify > core/test/runtimes/hpke.js
deno task minify > x/dhkem-secp256k1/test/runtimes/hpke.js
- name: Run test
working-directory: ./test/runtimes/cloudflare
Expand All @@ -33,18 +32,30 @@ jobs:
nohup npm start &
sleep 3
deno test hpke.spec.ts --allow-net
- working-directory: ./core/
- working-directory: ./core
run: |
deno task dnt
deno task minify > test/runtimes/hpke-core.js
deno task minify > ../x/dhkem-x25519/test/runtimes/hpke-core.js
- name: Run test for core
working-directory: ./core/test/runtimes/cloudflare
run: |
npm install
nohup npm start &
sleep 3
deno test core.spec.ts --allow-net
- working-directory: ./x/dhkem-secp256k1/
- working-directory: ./x/dhkem-x25519
run: |
deno task dnt
deno task minify > test/runtimes/hpke-dhkem-x25519.js
- name: Run test for dhkem-x25519
working-directory: ./x/dhkem-x25519/test/runtimes/cloudflare
run: |
npm install
nohup npm start &
sleep 3
deno test dhkem-x25519.spec.ts --allow-net
- working-directory: ./x/dhkem-secp256k1
run: |
deno task dnt
deno task minify > test/runtimes/hpke-dhkem-secp256k1.js
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
run: |
deno task dnt
deno task minify > ./npm/hpke-core.min.js
- name: Run dnt & minify for /x/dhkem-x25519
working-directory: ./x/dhkem-x25519
run: |
deno task dnt
deno task minify > ./npm/hpke-dhkem-x25519.min.js
- name: Run dnt & minify for /x/dhkem-secp256k1
working-directory: ./x/dhkem-secp256k1
run: |
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-dhkem-x25519:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Run dnt & minify
working-directory: ./x/dhkem-x25519
run: |
npm install -g esbuild
deno task dnt
deno task minify > ./npm/hpke-dhkem-x25519.min.js
- working-directory: ./x/dhkem-x25519/npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-dhkem-secp256k1:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions dnt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { build, emptyDir } from "dnt";
await emptyDir("./npm");
await emptyDir("./core/npm");
await emptyDir("./x/dhkem-secp256k1/npm");
await emptyDir("./x/dhkem-x25519/npm");

await build({
entryPoints: ["./mod.ts"],
Expand Down
Loading

0 comments on commit 25ca293

Please sign in to comment.