Skip to content

Commit 731c954

Browse files
authored
Merge pull request paperclipai#1222 from paperclipai/fix/github-release-origin-remote
fix: use origin for github release creation in actions
2 parents 78c714c + 528f836 commit 731c954

4 files changed

Lines changed: 26 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
type: string
1313
default: master
1414
stable_date:
15-
description: Stable release date in UTC (YYYY-MM-DD). First stable that day is .0, then .1, and so on.
15+
description: Enter a UTC date in YYYY-MM-DD format, for example 2026-03-18. Do not enter a version string. The workflow will resolve that date to a stable version such as 2026.318.0, then 2026.318.1 for the next same-day stable.
1616
required: false
1717
type: string
1818
dry_run:
@@ -251,6 +251,7 @@ jobs:
251251
- name: Create GitHub Release
252252
env:
253253
GH_TOKEN: ${{ github.token }}
254+
PUBLISH_REMOTE: origin
254255
run: |
255256
version="$(git tag --points-at HEAD | grep '^v' | head -1 | sed 's/^v//')"
256257
if [ -z "$version" ]; then

doc/RELEASE-AUTOMATION-SETUP.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ After at least one good canary exists:
222222
3. open `Actions` -> `Release`
223223
4. run it with:
224224
- `source_ref`: the tested commit SHA or canary tag source commit
225-
- `stable_date`: leave blank or set the intended UTC date
225+
- `stable_date`: leave blank or set the intended UTC date like `2026-03-18`
226+
do not enter a version like `2026.318.0`; the workflow computes that from the date
226227
- `dry_run`: `true`
227228
5. confirm the dry-run succeeds
228229
6. rerun with `dry_run: false`
@@ -231,6 +232,11 @@ After at least one good canary exists:
231232
9. confirm git tag `vYYYY.MDD.P` exists
232233
10. confirm the GitHub Release was created
233234

235+
Implementation note:
236+
237+
- the GitHub Actions stable workflow calls `create-github-release.sh` with `PUBLISH_REMOTE=origin`
238+
- local maintainer usage can still pass `PUBLISH_REMOTE=public-gh` explicitly when needed
239+
234240
## 13. Suggested Maintainer Policy
235241

236242
Use this policy going forward:

doc/RELEASING.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,31 @@ npx paperclipai@canary onboard --data-dir "$(mktemp -d /tmp/paperclip-canary.XXX
7777

7878
Use [`.github/workflows/release.yml`](../.github/workflows/release.yml) from the Actions tab with the manual `workflow_dispatch` inputs.
7979

80+
[Run the action here](https://github.com/paperclipai/paperclip/actions/workflows/release.yml)
81+
8082
Inputs:
8183

8284
- `source_ref`
8385
- commit SHA, branch, or tag
8486
- `stable_date`
8587
- optional UTC date override in `YYYY-MM-DD`
88+
- enter a date like `2026-03-18`, not a version like `2026.318.0`
8689
- `dry_run`
8790
- preview only when true
8891

8992
Before running stable:
9093

9194
1. pick the canary commit or tag you trust
92-
2. resolve the target stable version with `./scripts/release.sh stable --date YYYY-MM-DD --print-version`
95+
2. resolve the target stable version with `./scripts/release.sh stable --date "$(date +%F)" --print-version`
9396
3. create or update `releases/vYYYY.MDD.P.md` on that source ref
9497
4. run the stable workflow from that source ref
9598

99+
Example:
100+
101+
- `source_ref`: `master`
102+
- `stable_date`: `2026-03-18`
103+
- resulting stable version: `2026.318.0`
104+
96105
The workflow:
97106

98107
- re-verifies the exact source ref
@@ -122,7 +131,7 @@ This is mainly for emergency/manual use. The normal path is the GitHub workflow.
122131
```bash
123132
./scripts/release.sh stable
124133
git push public-gh refs/tags/vYYYY.MDD.P
125-
./scripts/create-github-release.sh YYYY.MDD.P
134+
PUBLISH_REMOTE=public-gh ./scripts/create-github-release.sh YYYY.MDD.P
126135
```
127136

128137
## Stable Changelog Workflow
@@ -217,7 +226,7 @@ This is a partial release. npm is already live.
217226
Do this immediately:
218227

219228
1. push the missing tag
220-
2. rerun `./scripts/create-github-release.sh YYYY.MDD.P`
229+
2. rerun `PUBLISH_REMOTE=public-gh ./scripts/create-github-release.sh YYYY.MDD.P`
221230
3. verify the GitHub Release notes point at `releases/vYYYY.MDD.P.md`
222231

223232
Do not republish the same version.

scripts/create-github-release.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ Examples:
1919
2020
Notes:
2121
- Run this after pushing the stable tag.
22-
- Defaults to git remote public-gh.
22+
- Resolves the git remote automatically.
23+
- In GitHub Actions, origin is used explicitly.
2324
- If the release already exists, this script updates its title and notes.
2425
EOF
2526
}
@@ -54,7 +55,9 @@ fi
5455

5556
tag="v$version"
5657
notes_file="$REPO_ROOT/releases/${tag}.md"
57-
PUBLISH_REMOTE="${PUBLISH_REMOTE:-public-gh}"
58+
if [ "${GITHUB_ACTIONS:-}" = "true" ] && [ -z "${PUBLISH_REMOTE:-}" ] && git_remote_exists origin; then
59+
PUBLISH_REMOTE=origin
60+
fi
5861
PUBLISH_REMOTE="$(resolve_release_remote)"
5962
if ! command -v gh >/dev/null 2>&1; then
6063
echo "Error: gh CLI is required to create GitHub releases." >&2

0 commit comments

Comments
 (0)