|
| 1 | +# Releasing Refman |
| 2 | + |
| 3 | +Refman uses semantic, three-part tags: `vX.Y.Z` (for example, `v0.12.0`). A tag |
| 4 | +push triggers [`.github/workflows/ci.yml`](.github/workflows/ci.yml), which tests |
| 5 | +the project and publishes the app ZIP, DMG, and Chrome extension ZIP. |
| 6 | + |
| 7 | +## 1. Prepare the version |
| 8 | + |
| 9 | +Update the Chrome extension version in all three places: |
| 10 | + |
| 11 | +- `extension/package.json` |
| 12 | +- `extension/package-lock.json` (both top-level occurrences) |
| 13 | +- `extension/public/manifest.json` |
| 14 | + |
| 15 | +The app version is not stored in source. The release workflow removes the |
| 16 | +leading `v` from the tag and passes the result to `scripts/build_app.sh`. |
| 17 | + |
| 18 | +## 2. Verify the release candidate |
| 19 | + |
| 20 | +Run: |
| 21 | + |
| 22 | +```sh |
| 23 | +swift test |
| 24 | +npm test --prefix extension |
| 25 | +npm run package --prefix extension |
| 26 | +unzip -p extension/refman-chrome-extension.zip manifest.json |
| 27 | +git diff --check |
| 28 | +VERSION=0.12.0 scripts/build_app.sh |
| 29 | +dist/Refman.app/Contents/MacOS/Refman --check-resources |
| 30 | +plutil -extract CFBundleShortVersionString raw dist/Refman.app/Contents/Info.plist |
| 31 | +codesign --verify --deep --strict dist/Refman.app |
| 32 | +``` |
| 33 | + |
| 34 | +Replace `0.12.0` with the intended version. If CSL resources changed, also run |
| 35 | +`xmllint --noout` on every added or modified `.csl` and locale XML file. |
| 36 | + |
| 37 | +After a successful code change, close the running Refman and open the verified |
| 38 | +build: |
| 39 | + |
| 40 | +```sh |
| 41 | +pkill -x Refman |
| 42 | +open dist/Refman.app |
| 43 | +``` |
| 44 | + |
| 45 | +## 3. Commit and tag |
| 46 | + |
| 47 | +Review and stage only the intended files, then create an annotated tag on the |
| 48 | +verified commit: |
| 49 | + |
| 50 | +```sh |
| 51 | +git status --short --branch |
| 52 | +git diff --cached --check |
| 53 | +git commit -m "Describe the release change" |
| 54 | +git tag -a v0.12.0 -m "Refman v0.12.0" |
| 55 | +git push --atomic origin master v0.12.0 |
| 56 | +``` |
| 57 | + |
| 58 | +The atomic push prevents `master` and the release tag from being updated |
| 59 | +separately. |
| 60 | + |
| 61 | +## 4. Monitor publication |
| 62 | + |
| 63 | +An atomic branch-and-tag push starts two CI runs. Monitor the run whose branch |
| 64 | +is the version tag; that run contains both the `build` and `release` jobs. Wait |
| 65 | +for every step to succeed, including packaged-resource verification and |
| 66 | +`Create release`. |
| 67 | + |
| 68 | +The release must contain these assets: |
| 69 | + |
| 70 | +- `Refman-vX.Y.Z.dmg` |
| 71 | +- `Refman-vX.Y.Z.zip` |
| 72 | +- `RefmanChrome-Extension-vX.Y.Z.zip` |
| 73 | + |
| 74 | +Finally, confirm that the release is public, not a draft or prerelease, and |
| 75 | +that <https://github.com/datavil/refman/releases/latest> resolves to the new |
| 76 | +version. Confirm the working tree is clean and synchronized with |
| 77 | +`origin/master`. |
| 78 | + |
| 79 | +If CI fails, fix the cause and rerun the failed workflow when the commit does |
| 80 | +not need to change. Do not move a published tag; use a patch release for source |
| 81 | +changes after publication. |
0 commit comments