Skip to content

Commit eb80fc0

Browse files
committed
Publish
1 parent baa6c71 commit eb80fc0

2 files changed

Lines changed: 53 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Publishing Workflow'
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+
18+
steps:
19+
# Checkout repository
20+
- uses: actions/checkout@v4
21+
with:
22+
ref: main
23+
24+
# Setup Node.js with OIDC Trusted Publishing
25+
- uses: actions/setup-node@v5
26+
with:
27+
node-version: '20'
28+
always-auth: true
29+
30+
# Setup Deno
31+
- uses: denoland/setup-deno@v2
32+
with:
33+
deno-version: v2.5
34+
35+
# Deno tasks
36+
- name: Test
37+
run: deno task test
38+
39+
- name: Clean
40+
run: deno task clean
41+
42+
- name: Build
43+
run: deno task build
44+
45+
# Publish
46+
- name: Publish
47+
run: deno task publish

tasks.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ 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}`)
39-
await Task.shell(`git tag ${version}`)
40-
await Task.shell(`git push origin ${version}`)
38+
await Task.shell('npm whoami', version)
39+
// await Task.shell(`cd ${target} && npm publish typebox-${version}.tgz --access=public`)
40+
// await Task.shell(`git tag ${version}`)
41+
// await Task.shell(`git push origin ${version}`)
4142
}
4243
// ------------------------------------------------------------------
4344
// Bench
@@ -58,7 +59,7 @@ Task.run('local', (target: string = `../build-test/node_modules/typebox`) => Bui
5859
// ------------------------------------------------------------------
5960
// Publish
6061
// ------------------------------------------------------------------
61-
Task.run('publish', (otp: string, target: string = `target/build`) => PublishPackage(otp, target))
62+
Task.run('publish', (target: string = `target/build`) => PublishPackage(target))
6263
// ------------------------------------------------------------------
6364
// Format
6465
// ------------------------------------------------------------------

0 commit comments

Comments
 (0)