|
| 1 | +# Build & Deploy |
| 2 | + |
| 3 | +## Regenerating Tables when the Unicode standard is updated |
| 4 | + |
| 5 | +To regenerate the Tables.cs file from the reference unicode files, run `Makefile` |
| 6 | +with the command `make tables`, which will create the updated tables. |
| 7 | + |
| 8 | +There is some work to be done to dump the tables as a binary blob, |
| 9 | +without going through the various data structures that we have now, it would |
| 10 | +avoid all these constructors triggered on the static class. |
| 11 | + |
| 12 | +## Version Numbers |
| 13 | + |
| 14 | +Version info for NStack is managed by [gitversion](https://gitversion.net). |
| 15 | + |
| 16 | +Install `gitversion`: |
| 17 | + |
| 18 | +```powershell |
| 19 | +dotnet tool install --global GitVersion.Tool |
| 20 | +dotnet-gitversion |
| 21 | +``` |
| 22 | + |
| 23 | +The project version (the nuget package and in `NStack.dll`) is determined from the latest `git tag`. |
| 24 | + |
| 25 | +The format of version numbers is `vmajor.minor.patch.build.height` and follows the [Semantic Versioning](https://semver.org/) rules. |
| 26 | + |
| 27 | +To define a new version (e.g. with a higher `major`, `minor`, `patch`, or `build` value) tag a commit using `git tag`: |
| 28 | + |
| 29 | +```powershell |
| 30 | +git tag v1.3.4-beta.5 -a -m "Release v1.3.4 Beta 5" |
| 31 | +dotnet-gitversion /updateprojectfiles |
| 32 | +dotnet build -c Release |
| 33 | +``` |
| 34 | + |
| 35 | +**DO NOT COMMIT AFTER USING `/updateprojectfiles`!** |
| 36 | + |
| 37 | +Doing so will update the `.csproj` files in your branch with version info, which we do not want. |
| 38 | + |
| 39 | +## Deploying a new version of the NStack Nuget Library |
| 40 | + |
| 41 | +To release a new version (e.g. with a higher `major`, `minor`, or `patch` value) tag a commit using `git tag` and then |
| 42 | +push that tag directly to the `main` branch on `github.com/gui-cs/NStack` (`upstream`). |
| 43 | + |
| 44 | +The `tag` must be of the form `v<major>.<minor>.<patch>`, e.g. `v2.3.4`. |
| 45 | + |
| 46 | +`patch` can indicate pre-release or not (e.g. `pre`, `beta`, `rc`, etc...). |
| 47 | + |
| 48 | +### 1) Verify the `develop` branch is ready for release |
| 49 | + |
| 50 | +* Ensure everything is committed and pushed to the `develop` branch |
| 51 | +* Ensure your local `develop` branch is up-to-date with `upstream/develop` |
| 52 | + |
| 53 | +### 2) Create a pull request for the release in the `develop` branch |
| 54 | + |
| 55 | +The PR title should be of the form "Release v2.3.4" |
| 56 | + |
| 57 | +```powershell |
| 58 | +git checkout develop |
| 59 | +git pull upstream develop |
| 60 | +git checkout -b v_2_3_4 |
| 61 | +git merge develop |
| 62 | +git add . |
| 63 | +git commit -m "Release v2.3.4" |
| 64 | +git push |
| 65 | +``` |
| 66 | + |
| 67 | +Go to the link printed by `git push` and fill out the Pull Request. |
| 68 | + |
| 69 | +### 3) On github.com, verify the build action worked on your fork, then merge the PR |
| 70 | + |
| 71 | +### 4) Pull the merged `develop` from `upstream` |
| 72 | + |
| 73 | +```powershell |
| 74 | +git checkout develop |
| 75 | +git pull upstream develop |
| 76 | +``` |
| 77 | + |
| 78 | +### 5) Merge `develop` into `main` |
| 79 | + |
| 80 | +```powershell |
| 81 | +git checkout main |
| 82 | +git pull upstream main |
| 83 | +git merge develop |
| 84 | +``` |
| 85 | + |
| 86 | +Fix any merge errors. |
| 87 | + |
| 88 | +### 6) Create a new annotated tag for the release on `main` |
| 89 | + |
| 90 | +```powershell |
| 91 | +git tag v2.3.4 -a -m "Release v2.3.4" |
| 92 | +``` |
| 93 | + |
| 94 | +### 7) Push the new tag to `main` on `upstream` |
| 95 | + |
| 96 | +```powershell |
| 97 | +git push --atomic upstream main v2.3.4 |
| 98 | +``` |
| 99 | + |
| 100 | +*See https://stackoverflow.com/a/3745250/297526* |
| 101 | + |
| 102 | +### 8) Monitor Github Actions to ensure the Nuget publishing worked. |
| 103 | + |
| 104 | +https://github.com/gui-cs/NStack/actions |
| 105 | + |
| 106 | +### 9) Check Nuget to see the new package version (wait a few minutes) |
| 107 | +https://www.nuget.org/packages/NStack.Core |
| 108 | + |
| 109 | +### 10) Add a new Release in Github: https://github.com/gui-cs/NStack/releases |
| 110 | + |
| 111 | +Generate release notes with the list of PRs since the last release |
| 112 | + |
| 113 | +Use `gh` to get a list with just titles to make it easy to paste into release notes: |
| 114 | + |
| 115 | +```powershell |
| 116 | +gh pr list --limit 500 --search "is:pr is:closed is:merged closed:>=2022-11-1" |
| 117 | +``` |
| 118 | +### 11) Update the `develop` branch with the new version |
| 119 | + |
| 120 | +```powershell |
| 121 | +git checkout develop |
| 122 | +git pull upstream develop |
| 123 | +git merge main |
| 124 | +git push upstream develop |
| 125 | +``` |
0 commit comments