Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 033295f345f2
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fb0fdf8b51c2
Choose a head ref
  • 8 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 2, 2019

  1. scripted release

    eggrobin committed Jun 2, 2019
    Copy the full SHA
    fdd3890 View commit details
  2. Document the new process.

    eggrobin authored Jun 2, 2019
    Copy the full SHA
    6db4a7c View commit details
  3. Copy the full SHA
    b625a9b View commit details

Commits on Jun 4, 2019

  1. Copy the full SHA
    8b906bd View commit details
  2. REMOVE BEFORE FLIGHT

    eggrobin committed Jun 4, 2019
    Copy the full SHA
    e4a8b23 View commit details
  3. space

    eggrobin committed Jun 4, 2019
    Copy the full SHA
    a934038 View commit details
  4. ""

    eggrobin committed Jun 4, 2019
    Copy the full SHA
    8b4393e View commit details

Commits on Jun 16, 2019

  1. Merge pull request #2193 from eggrobin/release-script

    Release script
    eggrobin authored Jun 16, 2019
    Copy the full SHA
    fb0fdf8 View commit details
Showing with 113 additions and 24 deletions.
  1. +5 −0 Principia.sln
  2. +7 −24 documentation/Releasing.md
  3. +101 −0 make_principia_release.ps1
5 changes: 5 additions & 0 deletions Principia.sln
Original file line number Diff line number Diff line change
@@ -82,9 +82,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "base", "base\base.vcxproj",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{B0F47E49-0EDF-4D58-AB27-F99CCCE4253A}"
ProjectSection(SolutionItems) = preProject
build_for_benchmarking.ps1 = build_for_benchmarking.ps1
debug_and_release_in_parallel.xml = debug_and_release_in_parallel.xml
find_msbuild.ps1 = find_msbuild.ps1
generate_version_translation_unit.ps1 = generate_version_translation_unit.ps1
install_deps.sh = install_deps.sh
make_principia_release.ps1 = make_principia_release.ps1
rebuild_all_solutions.ps1 = rebuild_all_solutions.ps1
rebuild_debug_and_release_in_parallel.ps1 = rebuild_debug_and_release_in_parallel.ps1
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "coverage_analyser", "coverage_analyser\coverage_analyser.csproj", "{06E78A3D-AAA0-4CD9-8F23-B5BBBBE6F14F}"
31 changes: 7 additions & 24 deletions documentation/Releasing.md
Original file line number Diff line number Diff line change
@@ -9,32 +9,15 @@ names with the appropriate cases.
- [ ] If using profile-guided optimization (PGO), make sure that the `PlayerTest.Benchmark` test contains the latest journal file name and has been merged as the last pull request.
- [ ] Check that the release name, release date, and lunation number for the following update, used by the update reminder, are correctly set in the adapter.
- [ ] Make sure that the project can be built and tested under Linux.
- [ ] Create and push a tag for the current state of mockingbirdnest/master, where `"yyyyMMddHH"` is the date of the new moon in UT1:
- [ ] Run the following command, where:
- `yyyyMMddHH` is the date of the new moon in UT1,
- `<language>` is the language code for the language in which `<Mathematician>` is written,
- `1.x.y` is the primary KSP version (the latest version targeted by the `Release` configuration), and
- `"1.u.v", ...` is the (possibly empty) comma-separated list of supported KSP versions that require a separate build, where each version number is quoted.
```powershell
$mathematician = "<Mathematician>"
git fetch la-vache
git checkout la-vache/master
git tag ("yyyyMMddHH-" + $mathematician) -m $mathematician
git push la-vache --tags
make_principia_release "<Mathematician>" "<language>" "yyyyMMddHH" "1.x.y" @("1.u.v", ...)
```
- [ ] In Visual Studio, select configuration `Release`, platform `x64`.
- [ ] Remove all existing artifacts: `rm .\Release`.
- [ ] Run `Build > Rebuild Solution`. This makes sure that the tools and generated code are up-to-date. It also creates the `journal_test.exe` binary.
- [ ] If using PGO, do the following:
- [ ] Select project `ksp_physics` and run `Build > Profile Guided Optimization > Instrument`.
- [ ] Select project `journal` and run `Project > Set as StartUp Project`
- [ ] With project `journal` selected, run `Project > Properties`. For configuration `Release` select the `Debugging` page and set `Command Arguments` to `--gtest_filter=PlayerTest*Benchmarks --gtest_also_run_disabled_tests`. Also set `Environment` to `PATH=$(VC_PGO_RunTime_Dir);$(LocalDebuggerEnvironment)`.
- [ ] Run `Debug > Start Without Debugging`.
- [ ] Answer `Do Not Continue With Build` to the dialog box that asks if you would want to rebuild `ksp_physics`.
- [ ] Answer `Yes` to the dialog box that informs you that there were build errors.
- [ ] The executable runs. This takes a long time, 3-4 times longer than without instrumentation. Have a cup of coffee.
- [ ] Select project `ksp_physics` and run `Build > Profile Guided Optimization > Optimize`. This creates the optimized `physics.dll`.
- [ ] Zip the contents of the `<root>\Principia\Release\GameData` folder into `principia <mathematician> for 1.x.y.zip`.
- [ ] If building releases for two versions of KSP, do the following:
- [ ] In Visual Studio, select configuration `Release KSP 1.u.v`, platform `x64`.
- [ ] Select project `ksp_plugin_adapter` and run `Build > Build ksp_plugin_adapter`
- [ ] Copy `principia <mathematician> for 1.x.y.zip` into `principia <mathematician> for 1.u.v.zip`.
- [ ] Add the contents of the `<root>\Principia\Release\1.u.v Compatibility\GameData` to `principia <mathematician> for 1.u.v.zip`, replacing files as necessary.
This creates `<root>\principia <mathematician> for 1.x.y.zip`, as well as `<root>\principia <mathematician> for 1.u.v.zip` as appropriate.
- [ ] Go to a Linux machine and checkout the newly created tag:
```shell
git fetch la-vache
101 changes: 101 additions & 0 deletions make_principia_release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
$ErrorActionPreference = "Stop"

"Usage:"
"make_principia_release mathematician culture date primary_ksp_version"
" compatibility_ksp_versions"
""
" ARGUMENT EXAMPLE VALUES"
" mathematician 陈景润"
" culture zh-CN"
" date 2017111812"
" primary_ksp_version 1.3.1"
" compatibility_ksp_versions @('1.2.1', '1.3.0')"


$mathematician = $args[0]
$culture = new-object CultureInfo $args[1]
$date = $args[2]
$primary_ksp_version = $args[3]
$compatibility_ksp_versions = $args[4]

if ($culture.lcid -eq 0x1000) {
write-error ("Culture $culture has LCID 0x1000.")
}

if (!($date -match '^\d{10}$')) {
write-error ("Argument $date should be the UT1 date of the new moon, " +
"rounded to the nearest hour, formatted yyyyMMddHH.")
exit 1
}

$msbuild = &".\find_msbuild.ps1"
$7zip = "${Env:ProgramFiles}\7-Zip\7z.exe"

$tag = "$date-$mathematician"

$remote = $(
git remote -v |
sls 'https://github.com/mockingbirdnest/Principia.git')[0].tostring().split()[0]

git fetch $remote

if ($tag -in $(git tag)) {
write-error ("Tag $tag already exists.")
}

git checkout "$remote/master"
git tag $tag -m $mathematician
git push $remote --tags

if (test-path .\Release) {
rm .\Release -recurse
}

&$msbuild `
/t:Clean `
/property:Configuration=Release `
/property:Platform=x64 `
.\Principia.sln

&$msbuild `
"/t:ksp_plugin;ksp_plugin_adapter" `
/property:Configuration=Release `
/property:Platform=x64 `
.\Principia.sln

foreach ($ksp_version in $compatibility_ksp_versions) {
&$msbuild `
/t:ksp_plugin_adapter `
"/property:Configuration=Release KSP $ksp_version" `
/property:Platform=x64 `
.\Principia.sln
}

# Sanity check: the error message in the adapter should mention all supported
# versions.

if (!(sls ([regex]::escape($primary_ksp_version)) -encoding Unicode `
".\Release\GameData\Principia\ksp_plugin_adapter.dll")) {
write-error ("Configuration Release does not target $primary_ksp_version.")
}

foreach ($ksp_version in $compatibility_ksp_versions) {
if (!(sls ([regex]::escape($ksp_version)) -encoding Unicode `
(".\Release\$ksp_version Compatibility\GameData\Principia\" +
"ksp_plugin_adapter.dll"))) {
write-error ("Configuration Release KSP $ksp_version does not target " +
"$ksp_version.")
}
}

$lowercase_mathematician = $mathematician.tolower($culture)

&$7zip a "principia $lowercase_mathematician for $primary_ksp_version.zip" `
".\Release\GameData"

foreach ($ksp_version in $compatibility_ksp_versions) {
cp "principia $lowercase_mathematician for $primary_ksp_version.zip" `
"principia $lowercase_mathematician for $ksp_version.zip"
&$7zip a "principia $lowercase_mathematician for $ksp_version.zip" `
".\Release\$ksp_version Compatibility\GameData"
}