Skip to content

Commit 9fa10b8

Browse files
committed
chore(api): update generated SDK content
29 generated files changed with no detected API surface change (documentation, examples, or file content). Build: 6aPtywqnq31mA0Jt268lz
1 parent a74adc7 commit 9fa10b8

30 files changed

Lines changed: 241 additions & 64 deletions
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release Please
2+
3+
on:
4+
# Fires when a human merges the platform-managed release PR into main
5+
# (the PR's base, so its diff shows the full pending release). Regenerations and
6+
# custom-code pushes only touch scalar-next and never run this workflow.
7+
push:
8+
branches:
9+
- main
10+
# Manual fallback only; nothing in the automated chain depends on dispatch.
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: write
15+
# Required to update the merged release PR's autorelease labels after tagging.
16+
pull-requests: write
17+
18+
jobs:
19+
release-please:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
release_created: ${{ steps.release.outputs.release_created }}
23+
steps:
24+
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
25+
id: release
26+
with:
27+
target-branch: main
28+
config-file: release-please-config.json
29+
manifest-file: .release-please-manifest.json
30+
# Release PRs are opened and updated by the Scalar platform with its own
31+
# credential (so their CI runs without manual approval); this workflow only
32+
# cuts the tag + GitHub Release once a release PR is merged.
33+
skip-github-pull-request: true
34+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
35+
if: ${{ steps.release.outputs.release_created == 'true' }}
36+
with:
37+
fetch-depth: 0
38+
# Merging the release PR into main is itself the promotion, but the
39+
# version bump and changelog must also land back on scalar-next, or the next
40+
# release PR would propose this release again. A real merge (never a plain
41+
# commit push) so a squash- or rebase-merged release PR syncs just as well; the
42+
# non-conventional message keeps the sync commit out of future changelogs. Plain
43+
# (non-force) push on purpose: losing a race against a concurrent regeneration
44+
# push fails loudly here, and the platform's next sync re-converges.
45+
- name: Sync release back to scalar-next
46+
if: ${{ steps.release.outputs.release_created == 'true' }}
47+
run: |
48+
git config user.name "github-actions[bot]"
49+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
50+
git fetch origin scalar-next
51+
git checkout -B scalar-next origin/scalar-next
52+
git merge --no-edit -m "Sync release ${{ steps.release.outputs.tag_name }} back to scalar-next" "${{ steps.release.outputs.sha }}"
53+
git push origin scalar-next

.github/workflows/sdk-ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Go SDK CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
verify:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
12+
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
13+
with:
14+
go-version: "1.22"
15+
- run: go build ./...
16+
- run: go vet ./...

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.1.0"
3+
}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const authedScalar = new Scalar({
9191
## Installation
9292

9393
```sh
94-
go get scalar-go
94+
go get github.com/scalar/scalar-go
9595
```
9696

9797
<br />
@@ -106,8 +106,8 @@ import (
106106
"fmt"
107107
"os"
108108

109-
sdk "scalar-go"
110-
"scalar-go/option"
109+
sdk "github.com/scalar/scalar-go"
110+
"github.com/scalar/scalar-go/option"
111111
)
112112

113113
func main() {
@@ -157,7 +157,7 @@ if err != nil {
157157
panic(err)
158158
}
159159

160-
// imports: sdk "scalar-go", "errors", "fmt"
160+
// imports: sdk "github.com/scalar/scalar-go", "errors", "fmt"
161161
```
162162

163163
Documented error statuses: `400`, `401`, `403`, `404`, `422`, `500`.
@@ -175,7 +175,7 @@ client := sdk.NewClient(
175175
option.WithRequestTimeout(60*time.Second),
176176
)
177177

178-
// imports: sdk "scalar-go", "scalar-go/option", "time"
178+
// imports: sdk "github.com/scalar/scalar-go", "github.com/scalar/scalar-go/option", "time"
179179
```
180180

181181
| Option | Type | Default | Description |

VERSIONING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Versioning
2+
3+
This SDK is configured with the `manual` versioning policy.
4+
5+
- `manual`: package versions are set explicitly before release.
6+
- `semver`: releases should follow semantic versioning based on API and SDK surface changes.
7+
- `calendar`: releases should use a calendar-derived version chosen by the release workflow or maintainer.
8+
9+
## Branches and releases
10+
11+
This repository follows a three-branch flow, managed by the Scalar platform together
12+
with the generated workflows (which need only the default `GITHUB_TOKEN` — no extra
13+
token required):
14+
15+
- **`scalar-generated`** — pristine generator output. Pushed by the Scalar platform; do
16+
not commit here.
17+
- **`scalar-next`** — generated output merged with this repository's custom code. Commit
18+
your customizations here (directly or via PRs). The Scalar platform merges each
19+
regeneration into this branch and keeps the release PR up to date; merge conflicts
20+
arrive as a PR from `scalar-merge-conflict` for you to resolve.
21+
- **Default branch** — seeded from the first generated snapshot, then only ever receives
22+
released states, each one the merge of a release PR.
23+
24+
Release PRs are opened by the Scalar platform from `scalar-next` against the default
25+
branch — so the PR diff shows the full pending release — and are versioned from
26+
[Conventional Commits](https://www.conventionalcommits.org). Merging a release PR tags the
27+
release, publishes it, and syncs the version bump and changelog back to `scalar-next`.
28+
Pre-1.0, breaking changes bump the minor version; to cut `1.0.0` (or any explicit
29+
version), push an empty commit with a `Release-As` footer to `scalar-next`:
30+
31+
```sh
32+
git commit --allow-empty -m "chore: release 1.0.0" -m "Release-As: 1.0.0"
33+
```
34+
35+
### When a release PR does not merge cleanly
36+
37+
Nothing is ever force-pushed automatically: a release PR that conflicts with the default
38+
branch simply cannot be merged, and GitHub disables its merge button. The two causes have
39+
different fixes:
40+
41+
- **The default branch received direct commits** (for example a hotfix) that are not in
42+
`scalar-next`. Land those commits on `scalar-next` (merge the default branch into it, or
43+
cherry-pick), and the refreshed release PR merges cleanly again. Do not force-push —
44+
that would discard the direct commits.
45+
- **The repository was adopted with pre-existing content**, so the default branch shares
46+
no history with `scalar-next`. The Scalar platform adds a checkbox to the release PR
47+
description offering to replace the default branch with this release; checking it
48+
authorizes the platform to force-push the released state over the old content. This is
49+
destructive for anything on the default branch that never reached `scalar-next`, which
50+
is why it requires that explicit opt-in.
51+
52+
### Repository prerequisites
53+
54+
- Branch protection on `scalar-next` and the default branch must allow the Scalar
55+
platform and the `github-actions` bot to push (or be left unprotected); the default
56+
branch only ever advances by merging release PRs, and `scalar-next` receives each
57+
released state back from the release workflow.
58+
- No Actions settings changes are required: the generated workflows declare their own
59+
permissions and never create pull requests.

aliases.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ import (
6969
"context"
7070
"fmt"
7171

72-
sdk "scalar-go"
72+
sdk "github.com/scalar/scalar-go"
7373
)
7474

7575
client := sdk.NewClient()

authentication.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

field.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scalargo
22

33
import (
4-
"scalar-go/internal/param"
4+
"github.com/scalar/scalar-go/internal/param"
55
"io"
66
)
77

0 commit comments

Comments
 (0)