Skip to content

Commit 2567593

Browse files
committed
Publish
1 parent 8bfeeaa commit 2567593

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/publish.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Publish
22

33
on:
4-
workflow_dispatch: # Manual Publish
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+**' # Semver-Tag
57

68
permissions:
7-
id-token: write # Required for OIDC
9+
id-token: write # Required for OIDC
810
contents: read
911

1012
jobs:
@@ -36,4 +38,5 @@ jobs:
3638

3739
# Publish
3840
- name: Publish
39-
run: deno task publish
41+
run: npm publish typebox-*.tgz --provenance --access public
42+
working-directory: target/build

tasks.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Range } from './task/range/index.ts'
88
import { Metrics } from './task/metrics/index.ts'
99
import { Task } from 'tasksmith'
1010

11-
const Version = '1.0.21'
11+
const Version = '1.0.20'
1212

1313
// ------------------------------------------------------------------
1414
// BuildPackage
@@ -33,9 +33,9 @@ const BuildPackage = (target: string = `target/build`) => Task.build.esm('src',
3333
// ------------------------------------------------------------------
3434
// PublishPackage
3535
// ------------------------------------------------------------------
36-
const PublishPackage = async (target: string = `target/build`) => {
36+
const PublishPackage = async (otp: string, 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 --provenance --access=public`)
38+
await Task.shell(`cd ${target} && npm publish typebox-${version}.tgz --access=public --otp ${otp}`)
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', (target: string = `target/build`) => PublishPackage(target))
61+
Task.run('publish', (otp: string, target: string = `target/build`) => PublishPackage(otp, target))
6262
// ------------------------------------------------------------------
6363
// Format
6464
// ------------------------------------------------------------------

0 commit comments

Comments
 (0)