Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Prepare release

on:
push:
branches:
- main
workflow_dispatch:

permissions:
actions: write
contents: write
issues: write
pull-requests: write

jobs:
release-please:
name: Update release pull request
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- id: release
uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071 # v4.4.1
with:
skip-github-release: true
- name: Verify release pull request
if: steps.release.outputs.prs_created == 'true'
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ steps.release.outputs.pr }}
shell: bash
run: |
head_branch=$(jq --exit-status --raw-output '.headBranchName' <<< "$PR")
gh workflow run ci.yml --ref "$head_branch"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass the repository to gh before dispatching CI

When Release Please creates or updates a PR, this step runs in a job that never checks out the repository and does not set GH_REPO, so gh workflow run has no local Git remote from which to determine the target repository and the dispatch fails instead of running CI for the bot-created head. The gh workflow run manual exposes -R, --repo [HOST/]OWNER/REPO for this context; pass --repo "$GITHUB_REPOSITORY" (or set GH_REPO) here so release PR verification actually runs.

Useful? React with 👍 / 👎.

3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.4.0"
}
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@file_router/cli",
"version": "0.3.0",
"version": "0.4.0",
"description": "Parse and compare documents across providers from the command line.",
"keywords": [
"documents",
Expand Down
2 changes: 1 addition & 1 deletion packages/filerouter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@file_router/sdk",
"version": "0.3.0",
"version": "0.4.0",
"description": "Provider-neutral document parsing SDK.",
"keywords": [
"documents",
Expand Down
2 changes: 1 addition & 1 deletion packages/filerouter/src/hosted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
import type { ProviderId } from "./catalog"

export const FILEROUTER_API_KEY_PREFIX = "fr_"
export const FILEROUTER_VERSION = "0.3.0"
export const FILEROUTER_VERSION = "0.4.0" // x-release-please-version
export const FILEROUTER_CLI_CLIENT_ID = "filerouter-cli"
export const FILEROUTER_CLI_SCOPE = "jobs:create jobs:read"
export const FILEROUTER_DEFAULT_API_URL = "https://filerouter.dev"
Expand Down
27 changes: 27 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"bootstrap-sha": "b752a146619c905dd1a7f891b66db5b496f2b383",
"include-component-in-tag": false,
"include-v-in-tag": true,
"packages": {
".": {
"extra-files": [
{
"path": "packages/filerouter/package.json",
"type": "json"
},
{
"path": "packages/cli/package.json",
"type": "json"
},
{
"path": "packages/filerouter/src/hosted.ts",
"type": "generic"
}
],
"package-name": "filerouter",
"release-type": "simple",
"version-file": "version.txt"
}
}
}
18 changes: 15 additions & 3 deletions scripts/verify-release-packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,21 @@ const exec = promisify(execFile)
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..")
const sdkPackage = await readJson("packages/filerouter/package.json")
const cliPackage = await readJson("packages/cli/package.json")

if (sdkPackage.version !== cliPackage.version) {
throw new Error("SDK and CLI package versions must match.")
const releaseManifest = await readJson(".release-please-manifest.json")
const releaseVersion = (
await readFile(join(root, "version.txt"), "utf8")
).trim()

for (const [source, version] of [
["CLI package", cliPackage.version],
["release manifest", releaseManifest["."]],
["version file", releaseVersion],
]) {
if (version !== sdkPackage.version) {
throw new Error(
`${source} version ${version} does not match SDK version ${sdkPackage.version}.`
)
}
}
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(sdkPackage.version)) {
throw new Error(`Invalid release version: ${sdkPackage.version}`)
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.4.0