Skip to content

Commit 57d0677

Browse files
committed
Publish
1 parent baa6c71 commit 57d0677

2 files changed

Lines changed: 42 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Manual Publish'
8+
required: false
9+
10+
permissions:
11+
id-token: write # Required for OIDC
12+
contents: read
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
steps:
18+
19+
# Checkout
20+
- uses: actions/checkout@v4
21+
22+
# Install Node
23+
- uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
registry-url: 'https://registry.npmjs.org'
27+
28+
# Install Deno
29+
- uses: denoland/setup-deno@v2
30+
with:
31+
deno-version: v2.5
32+
33+
# Build
34+
- name: Build
35+
run: deno task build
36+
37+
# Publish
38+
- name: Publish
39+
run: deno task publish

tasks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ const BuildPackage = (target: string = `target/build`) => Task.build.esm('src',
3333
// ------------------------------------------------------------------
3434
// PublishPackage
3535
// ------------------------------------------------------------------
36-
const PublishPackage = async (otp: string, target: string = `target/build`) => {
36+
const PublishPackage = async (target: string = `target/build`) => {
3737
const { version } = JSON.parse(await Task.file(`${target}/package.json`).read())
38-
await Task.shell(`cd ${target} && npm publish typebox-${version}.tgz --access=public --otp ${otp}`)
38+
await Task.shell(`cd ${target} && npm publish typebox-${version}.tgz --access=public`)
3939
await Task.shell(`git tag ${version}`)
4040
await Task.shell(`git push origin ${version}`)
4141
}
@@ -58,7 +58,7 @@ Task.run('local', (target: string = `../build-test/node_modules/typebox`) => Bui
5858
// ------------------------------------------------------------------
5959
// Publish
6060
// ------------------------------------------------------------------
61-
Task.run('publish', (otp: string, target: string = `target/build`) => PublishPackage(otp, target))
61+
Task.run('publish', (target: string = `target/build`) => PublishPackage(target))
6262
// ------------------------------------------------------------------
6363
// Format
6464
// ------------------------------------------------------------------

0 commit comments

Comments
 (0)