-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (135 loc) · 6.41 KB
/
Copy pathrelease-opencode.yml
File metadata and controls
141 lines (135 loc) · 6.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# GENERATED by sdk-actions `bin/workflow` — update with: bin/workflow update <this file>
# sdk-actions: {"template":"release/js/turnkey","ref":"71731d4a726df3e3bf42e50c2da4a75842b038dd","version":"1.0.0","params":{"access":"public","allowed_channels":"latest,rc,next,beta","dry_run_environment":"npm-opencode-dry-run","emoji":":javascript:","node_version":"src/plugins/opencode/content/.tool-versions","package_name":"@braintrust/trace-opencode","provenance":"true","publish_environment":"npm-opencode","slack_channel_var":"SLACK_SDK_RELEASE_CHANNEL","slack_token_secret":"SLACK_BOT_TOKEN","workflow_name":"Release OpenCode","working_directory":"src/plugins/opencode/content"}}
name: Release OpenCode
# Releases @braintrust/trace-opencode to npm via braintrustdata/sdk-actions. Dispatch after merging
# the commit that bumps package.json's "version"; the release runs against that commit's SHA.
on:
workflow_dispatch:
inputs:
release_type:
description: "Release type (stable → GitHub release; prerelease → none)"
type: choice
default: stable
options: [stable, prerelease]
channel:
description: "npm dist-tag / channel"
type: choice
default: latest
options: [latest, rc, next, beta]
sha:
description: "Commit SHA (of the version bump) to release"
required: true
type: string
prev_release:
description: "Release-notes anchor: a tag or SHA (empty → the previous tag)"
type: string
required: false
dry_run:
description: "Dry run: build without tagging or publishing"
type: boolean
default: false
jobs:
# FACT-FIND — derive version/tag/notes, check the registry, and emit the package manifest.
# contents: write is for the releases/generate-notes API.
configure:
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
contents: write
outputs:
version: ${{ steps.configure.outputs.version }}
release_tag: ${{ steps.configure.outputs.release_tag }}
prev_release: ${{ steps.configure.outputs.prev_release }}
branch: ${{ steps.configure.outputs.branch }}
on_release_branch: ${{ steps.configure.outputs.on_release_branch }}
commit_message: ${{ steps.configure.outputs.commit_message }}
channel: ${{ steps.configure.outputs.channel }}
github_release: ${{ steps.configure.outputs.github_release }}
already_published: ${{ steps.configure.outputs.already_published }}
notes: ${{ steps.configure.outputs.notes }}
package: ${{ steps.configure.outputs.package }}
steps:
- name: Configure release
id: configure
uses: braintrustdata/sdk-actions/actions/release/lang/js/configure@71731d4a726df3e3bf42e50c2da4a75842b038dd
with:
sha: ${{ inputs.sha }}
working_directory: src/plugins/opencode/content
tag_format: 'v{version}-opencode'
release_type: ${{ inputs.release_type }}
npm_channel: ${{ inputs.channel }}
npm_package_name: '@braintrust/trace-opencode'
package_label: '@braintrust/trace-opencode'
emoji: ':javascript:'
prev_release: ${{ inputs.prev_release }}
validate:
needs: [configure]
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Validate release
uses: braintrustdata/sdk-actions/actions/release/lang/js/validate@71731d4a726df3e3bf42e50c2da4a75842b038dd
with:
sha: ${{ inputs.sha }}
dry_run: ${{ inputs.dry_run }}
working_directory: src/plugins/opencode/content
node_version: src/plugins/opencode/content/.tool-versions
release_tag: ${{ needs.configure.outputs.release_tag }}
channel: ${{ needs.configure.outputs.channel }}
allowed_channels: 'latest,rc,next,beta'
on_release_branch: ${{ needs.configure.outputs.on_release_branch }}
notes: ${{ needs.configure.outputs.notes }}
already_published: ${{ needs.configure.outputs.already_published }}
enforce_release_branch: 'true'
request-approval:
needs: [configure, validate]
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions: {}
steps:
- name: Request release approval
uses: braintrustdata/sdk-actions/actions/release/request-approval@71731d4a726df3e3bf42e50c2da4a75842b038dd
with:
packages: '{"packages":[${{ needs.configure.outputs.package }}]}'
sha: ${{ inputs.sha }}
branch: ${{ needs.configure.outputs.branch }}
on_release_branch: ${{ needs.configure.outputs.on_release_branch }}
commit_message: ${{ needs.configure.outputs.commit_message }}
dry_run: ${{ inputs.dry_run }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: ${{ vars.SLACK_SDK_RELEASE_CHANNEL }}
build-and-ship:
needs: [configure, validate, request-approval]
runs-on: ubuntu-24.04
timeout-minutes: 15
environment: ${{ inputs.dry_run && 'npm-opencode-dry-run' || 'npm-opencode' }}
permissions:
contents: write
id-token: write # OIDC trusted publishing + provenance
attestations: write # signed SBOM attestation
steps:
- name: Build and ship
uses: braintrustdata/sdk-actions/actions/release/lang/js/build-and-ship@71731d4a726df3e3bf42e50c2da4a75842b038dd
with:
sha: ${{ inputs.sha }}
working_directory: src/plugins/opencode/content
node_version: src/plugins/opencode/content/.tool-versions
dry_run: ${{ inputs.dry_run }}
release_tag: ${{ needs.configure.outputs.release_tag }}
already_published: ${{ needs.configure.outputs.already_published }}
github_release: ${{ needs.configure.outputs.github_release }}
version: ${{ needs.configure.outputs.version }}
access: 'public'
provenance: 'true'
channel: ${{ needs.configure.outputs.channel }}
package_name: '@braintrust/trace-opencode'
label: '@braintrust/trace-opencode'
notes: ${{ needs.configure.outputs.notes }}
prev_release: ${{ needs.configure.outputs.prev_release }}
branch: ${{ needs.configure.outputs.branch }}
on_release_branch: ${{ needs.configure.outputs.on_release_branch }}
slack_token: ${{ secrets.SLACK_BOT_TOKEN }}
slack_channel: ${{ vars.SLACK_SDK_RELEASE_CHANNEL }}
emoji: ':javascript:'