Skip to content

Commit b84c022

Browse files
committed
ci(release): auto-sync distribution manifests after publish
All four channels (homebrew cask, scoop, winget, flatpak) were stuck on stale versions / placeholder SHAs because update-shas.sh used the wrong artifact names (e.g. open-codesign.Setup.X.exe instead of the actual open-codesign-X-x64-setup.exe electron-builder emits). - Rewrite update-shas.sh to read SHA256SUMS.txt from the release, handle per-arch Windows installers, cover flatpak, and derive the mac .app bundle / Windows .exe name from productName in electron-builder.yml so the upcoming "Open CoDesign" rename propagates automatically. - Fix URL templates: cask intel is -x64.dmg, scoop splits x64/arm64 with proper autoupdate, winget has separate Architecture entries. - Fill v0.1.2 SHAs across every manifest. - Add a bump-manifests job to release.yml that runs after publish, syncs packaging/ from the release, and commits back to main with [skip ci]. - Align winget identifier with release.yml: OpenCoworkAI.OpenCoDesign (PascalCase). Stale 0.1.1 winget dir + top-level seed file removed.
1 parent 189184f commit b84c022

13 files changed

Lines changed: 318 additions & 176 deletions

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,60 @@ jobs:
344344
env:
345345
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
346346

347+
# ------------------------------------------------------------------
348+
# Sync in-repo distribution manifests (cask / scoop / winget / flatpak)
349+
# to the freshly-published release. Pulls SHA256SUMS.txt from the
350+
# release, rewrites version strings + checksums + URLs across all four
351+
# channels, and commits the diff back to main so the packaging/ tree
352+
# stays in sync without a manual step.
353+
# ------------------------------------------------------------------
354+
bump-manifests:
355+
name: Sync packaging manifests to release
356+
needs: [publish]
357+
runs-on: ubuntu-latest
358+
if: github.event_name == 'push' && !contains(github.ref_name, '-')
359+
permissions:
360+
contents: write
361+
steps:
362+
- uses: actions/checkout@v4
363+
with:
364+
# Check out the default branch (not the tag) so the commit lands
365+
# on main. We pass the version explicitly to the script.
366+
ref: main
367+
fetch-depth: 0
368+
token: ${{ secrets.GITHUB_TOKEN }}
369+
370+
- name: Derive version from tag
371+
id: ver
372+
run: |
373+
version="${GITHUB_REF_NAME#v}"
374+
echo "version=${version}" >> "$GITHUB_OUTPUT"
375+
376+
- name: Run update-shas.sh
377+
env:
378+
GITHUB_REF_NAME: ${{ github.ref_name }}
379+
run: ./packaging/update-shas.sh "${{ steps.ver.outputs.version }}"
380+
381+
- name: Commit + push
382+
run: |
383+
if git diff --quiet packaging/; then
384+
echo "::notice::packaging/ already up to date — no commit"
385+
exit 0
386+
fi
387+
git config user.name "github-actions[bot]"
388+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
389+
git add packaging/
390+
git commit -m "chore(release): sync manifests to ${GITHUB_REF_NAME}
391+
392+
Auto-generated by .github/workflows/release.yml after publishing
393+
${GITHUB_REF_NAME}. Pulls SHA256SUMS.txt from the release and
394+
rewrites cask / scoop / winget / flatpak manifests to match.
395+
396+
[skip ci]"
397+
# Rebase in case main advanced while the release job ran.
398+
git pull --rebase origin main
399+
git push origin HEAD:main
400+
347401
# ------------------------------------------------------------------
348402
# Homebrew Cask bump — opens a PR against OpenCoworkAI/homebrew-tap
349403
# with the new version + sha256 of the mac DMGs.

packaging/README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Distribution channels
22

3-
Canonical sources for Open CoDesign's package manager manifests. The `packaging/` tree is the source of truth; after each release we run `update-shas.sh` to fill in checksums, commit here, then mirror the per-channel files to the downstream repos listed below.
3+
Canonical sources for Open CoDesign's package manager manifests. The `packaging/` tree is the source of truth; after each tag push `release.yml` auto-runs `update-shas.sh` and commits the synced manifests back to `main`.
44

55
All artifacts are **unsigned** for the v0.1 line. Each channel's README / caveats explains the Gatekeeper or SmartScreen workaround.
66

@@ -11,28 +11,32 @@ packaging/
1111
├── homebrew/
1212
│ └── Casks/open-codesign.rb
1313
├── winget/
14-
│ └── manifests/o/OpenCoworkAI/open-codesign/<version>/
15-
│ ├── OpenCoworkAI.open-codesign.yaml
16-
│ ├── OpenCoworkAI.open-codesign.installer.yaml
17-
│ └── OpenCoworkAI.open-codesign.locale.en-US.yaml
14+
│ └── manifests/o/OpenCoworkAI/OpenCoDesign/<version>/
15+
│ ├── OpenCoworkAI.OpenCoDesign.yaml
16+
│ ├── OpenCoworkAI.OpenCoDesign.installer.yaml
17+
│ └── OpenCoworkAI.OpenCoDesign.locale.en-US.yaml
1818
├── scoop/
1919
│ └── bucket/open-codesign.json
20+
├── flatpak/
21+
│ └── ai.opencowork.codesign.yaml
2022
└── update-shas.sh
2123
```
2224

2325
## Release flow
2426

25-
1. Push a `vX.Y.Z` tag — `release.yml` builds and publishes the DMG / EXE / AppImage on GitHub Releases.
26-
2. Once the release is live, run from the repo root:
27+
1. Push a `vX.Y.Z` tag. `release.yml` builds + publishes the installers.
28+
2. After `publish` succeeds, the **`bump-manifests`** job auto-runs `update-shas.sh`: it pulls `SHA256SUMS.txt` from the release, rewrites versions / URLs / checksums across all four channels (and auto-creates the new winget version directory by copying from the previous one), then commits the diff back to `main` as `chore(release): sync manifests to vX.Y.Z`.
29+
3. Downstream mirroring (tap / bucket / winget-pkgs / Flathub) is still handled per-channel — see below.
2730

28-
```sh
29-
./packaging/update-shas.sh
30-
```
31+
To run the sync manually (e.g. to backfill a past release or test script changes):
3132

32-
It downloads every artifact, computes SHA256, and rewrites the placeholders (`REPLACE_WITH_*_SHA256`) in all three channels' manifests. If you're on slow internet or offline, pass a local directory of pre-downloaded artifacts as the second arg.
33+
```sh
34+
./packaging/update-shas.sh # uses apps/desktop/package.json version
35+
./packaging/update-shas.sh 0.1.2 # override version
36+
./packaging/update-shas.sh 0.1.2 ./dist # hash local artifacts instead of downloading
37+
```
3338

34-
3. `git diff packaging/`, sanity-check, commit.
35-
4. Mirror to the downstream repos (see below). The tap and bucket repos watch this tree, so the usual workflow is a copy-push per channel.
39+
The script derives the mac `.app` bundle name and Windows `.exe` from `productName` in `apps/desktop/electron-builder.yml`, so renaming productName propagates into the cask's `app` field and the scoop `bin` automatically.
3640

3741
## Channel-specific mirroring
3842

@@ -60,16 +64,16 @@ brew install --cask open-codesign
6064

6165
### winget — `microsoft/winget-pkgs`
6266

63-
Microsoft's monorepo. Fork it, copy `packaging/winget/manifests/o/OpenCoworkAI/open-codesign/<version>/` into the same path in the fork, open a PR. `wingetcreate validate` is worth running first:
67+
Microsoft's monorepo. Fork it, copy `packaging/winget/manifests/o/OpenCoworkAI/OpenCoDesign/<version>/` into the same path in the fork, open a PR. `wingetcreate validate` is worth running first:
6468

6569
```sh
66-
wingetcreate validate packaging/winget/manifests/o/OpenCoworkAI/open-codesign/0.1.0
70+
wingetcreate validate packaging/winget/manifests/o/OpenCoworkAI/OpenCoDesign/0.1.2
6771
```
6872

6973
Users install with:
7074

7175
```pwsh
72-
winget install OpenCoworkAI.open-codesign
76+
winget install OpenCoworkAI.OpenCoDesign
7377
```
7478

7579
### Scoop — `OpenCoworkAI/scoop-bucket`

packaging/flatpak/ai.opencowork.codesign.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ modules:
3838
- type: extra-data
3939
filename: open-codesign.AppImage
4040
url: https://github.com/OpenCoworkAI/open-codesign/releases/download/v0.1.2/open-codesign-0.1.2-x64.AppImage
41-
sha256: REPLACE_WITH_REAL_SHA256_FROM_RELEASE
42-
size: 0 # fill in from ls -l on the AppImage
41+
sha256: eb8ea485f2ebcac0e54621ed505cb112e3ef0018d35dee49c6c4cd497e7cadfb
42+
size: 142067225
4343
- type: script
4444
dest-filename: apply_extra
4545
commands:

packaging/homebrew/Casks/open-codesign.rb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
cask "open-codesign" do
2-
version "0.1.1"
2+
version "0.1.2"
33

44
on_arm do
5-
url "https://github.com/OpenCoworkAI/open-codesign/releases/download/v#{version}/open-codesign-#{version}-arm64.dmg"
6-
sha256 "REPLACE_WITH_ARM64_SHA256"
5+
url "https://github.com/OpenCoworkAI/open-codesign/releases/download/v#{version}/open-codesign-#{version}-arm64.dmg",
6+
verified: "github.com/OpenCoworkAI/open-codesign/"
7+
sha256 "6c3be603e32340c017b66ad8cd01822aa21a98cc28c3aac56912a94c0b53d5c4"
78
end
89
on_intel do
9-
url "https://github.com/OpenCoworkAI/open-codesign/releases/download/v#{version}/open-codesign-#{version}.dmg"
10-
sha256 "REPLACE_WITH_X64_SHA256"
10+
url "https://github.com/OpenCoworkAI/open-codesign/releases/download/v#{version}/open-codesign-#{version}-x64.dmg",
11+
verified: "github.com/OpenCoworkAI/open-codesign/"
12+
sha256 "349efb65326ff067c85b4d07731bcd04e17319707e3709f9c33a327ce9141753"
1113
end
1214

1315
name "Open CoDesign"
1416
desc "Open-source desktop AI design tool — prompt to prototype, BYOK, local-first"
15-
homepage "https://github.com/OpenCoworkAI/open-codesign"
17+
homepage "https://opencoworkai.github.io/open-codesign/"
18+
19+
livecheck do
20+
url :url
21+
strategy :github_latest
22+
end
1623

1724
auto_updates false
1825
depends_on macos: ">= :big_sur"

packaging/homebrew/open-codesign.rb

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
11
{
2-
"version": "0.1.1",
2+
"version": "0.1.2",
33
"description": "Open-source desktop AI design tool — prompt to prototype, BYOK, local-first",
4-
"homepage": "https://github.com/OpenCoworkAI/open-codesign",
4+
"homepage": "https://opencoworkai.github.io/open-codesign/",
55
"license": "MIT",
6-
"url": "https://github.com/OpenCoworkAI/open-codesign/releases/download/v0.1.1/open-codesign.Setup.0.1.1.exe#/dl.7z",
7-
"hash": "REPLACE_WITH_WIN_SHA256",
6+
"architecture": {
7+
"64bit": {
8+
"url": "https://github.com/OpenCoworkAI/open-codesign/releases/download/v0.1.2/open-codesign-0.1.2-x64-setup.exe#/dl.7z",
9+
"hash": "328768b7dbb400cd7d15267037acd4ac03b64f15cd3d6eb1c80e58f5abe82e74"
10+
},
11+
"arm64": {
12+
"url": "https://github.com/OpenCoworkAI/open-codesign/releases/download/v0.1.2/open-codesign-0.1.2-arm64-setup.exe#/dl.7z",
13+
"hash": "d6c475044c10d8f66a7f0f65dbabf2b488061235d29cdcfb7db3f116c0466cdc"
14+
}
15+
},
816
"bin": "open-codesign.exe",
917
"shortcuts": [
1018
[
1119
"open-codesign.exe",
1220
"Open CoDesign"
1321
]
1422
],
15-
"checkver": {
16-
"github": "https://github.com/OpenCoworkAI/open-codesign"
17-
},
23+
"checkver": "github",
1824
"autoupdate": {
19-
"url": "https://github.com/OpenCoworkAI/open-codesign/releases/download/v$version/open-codesign.Setup.$version.exe#/dl.7z"
25+
"architecture": {
26+
"64bit": {
27+
"url": "https://github.com/OpenCoworkAI/open-codesign/releases/download/v$version/open-codesign-$version-x64-setup.exe#/dl.7z"
28+
},
29+
"arm64": {
30+
"url": "https://github.com/OpenCoworkAI/open-codesign/releases/download/v$version/open-codesign-$version-arm64-setup.exe#/dl.7z"
31+
}
32+
}
2033
}
2134
}

0 commit comments

Comments
 (0)