Merge pull request #1427 from premake/release-improvements

Fix up and improve the release docs and script
This commit is contained in:
Samuel Surtees 2020-04-22 22:58:55 +10:00 committed by GitHub
commit 012c3418b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 94 additions and 105 deletions

50
scripts/RELEASE.md Normal file
View File

@ -0,0 +1,50 @@
# PREMAKE RELEASE CHECKLIST
## PREP
* Create a new release branch; push to origin
* Notify `@premakeapp` of release branch availability; request testing
* Update `CHANGES.txt`
* `premake5 --file=scripts/changes.lua --since=<last_release_rev> changes`
* Review and clean up as needed
* Update `README.md`
* "Commits since last release" badge (once out of prerelease replace `v5.0.0-alphaXX` with `latest`)
* Update version in `src/host/premake.h`
* Commit `CHANGES.txt`, `README.txt`, `src/host/premake.h`
* Push release branch to GitHub; wait for CI to pass
* Prep release announcement from change log
## RELEASE
* Run `premake5 package <release branch name> source` (from Posix ideally)
* On each platform, run `premake5 package <release branch name> binary`
* Merge working branch to release and tag; push with tags
* Create new release on GitHub from `CHANGES.txt`; upload files
* Update the download page on github.io
* Post annoucement to `@premakeapp`
## CYCLE
* Update version in `src/host/premake.h` (e.x `"5.0.0-dev"`)
* Commit
* Merge release branch to master
* Delete release branch

View File

@ -1,45 +0,0 @@
PREMAKE RELEASE CHECKLIST
-------------------------
PREP
* Create a new release branch and push to origin
* Notify developer list of release branch availability; request testing
* Update CHANGES.txt (`git log release-branch-name ^release --merges`)
* Update README.md
* "Commits since last release" badge - once out of prerelease replace `v5.0.0-alphaXX` with `latest`
* Update version in src/host/premake.h and commit
* Push release branch to GitHub; wait for CI to pass
* Prep release announcement for forums from change log
RELEASE
* Run `premake5 package <release branch name> source` (from Posix ideally)
* On each platform, run `premake5 package <release branch name> binary`
* Merge working branch to release and tag; push with tags
* Create new release on GitHub from CHANGES.txt; upload files
* Update the download page on github.io
* Post release announcement to the forums
* Post annoucement to @industrious on Twitter
CYCLE
* Update to new dev version in src/host/premake.h and commit
* Merge working branch to master
* Close working branch

View File

@ -1,85 +1,69 @@
---
-- Output a list of merged PRs since last release in the CHANGES.txt format
-- Output a list of merged PRs since last release in the CHANGES.txt format.
---
local format_separator = "||"
local usage = "Usage: premake5 --file=scripts/changes.lua --since=<rev> changes"
local git_command_raw = 'git log '..
'%s/master "^%s/release" '..
'--merges --first-parent '..
'--pretty="%%s%s%%b" '..
'--grep="Merge pull request #"'
local sinceRev = _OPTIONS["since"]
local changes_pr_format = "* PR #%s %s (@%s)"
local function parse_log(line)
change = {}
for chunk in line:gmatch(string.format("[^%s]+", format_separator)) do
table.insert(change, chunk)
end
assert(#change == 2)
local _, _, pr_num = change[1]:find("%s#([%d]+)%s")
local _, _, pr_author = change[1]:find("from%s([^/]+)")
local pr_desc = change[2]
return {
number = tonumber(pr_num),
author = pr_author,
description = pr_desc
}
if not sinceRev then
print(usage)
error("Missing `--since`", 0)
end
local function gather_changes()
local git_command = git_command_raw:format(_OPTIONS["remote"], _OPTIONS["remote"], format_separator)
local output = os.outputof(git_command)
local function parsePullRequestId(line)
return line:match("#%d+%s")
end
local function parseTitle(line)
return line:match("||(.+)")
end
local function parseAuthor(line)
return line:match("%s([^%s]-)/")
end
local function parseLog(line)
local pr = parsePullRequestId(line)
local title = parseTitle(line)
local author = parseAuthor(line)
return string.format("* PR %s %s (@%s)", pr, title, author)
end
local function gatherChanges()
local cmd = string.format('git log HEAD "^%s" --merges --first-parent --format="%%s||%%b"', _OPTIONS["since"])
local output = os.outputof(cmd)
changes = {}
for line in output:gmatch("[^\r\n]+") do
table.insert(changes, parse_log(line))
table.insert(changes, parseLog(line))
end
return changes
end
local function format_to_changes(changes)
changes_copy = changes
local function compare_changes(a, b)
return a.number < b.number
end
table.sort(changes, compare_changes)
for _, change in pairs(changes_copy) do
print(string.format(changes_pr_format, change.number, change.description, change.author))
local function generateChanges()
local changes = gatherChanges()
table.sort(changes)
for i = 1, #changes do
print(changes[i])
end
end
local function generate_changes()
changes = gather_changes()
format_to_changes(changes)
end
newaction {
trigger = "changes",
description = "Generate a file containing merged pull requests in CHANGES.txt format",
execute = generate_changes
description = "Generate list of git merges in CHANGES.txt format",
execute = generateChanges
}
newoption {
trigger = "remote",
value = "remoteName",
description = "Git remote to operate on.",
default = "origin",
trigger = "since",
value = "revision",
description = "Log merges since this revision"
}
---
-- Check the command line arguments, and show some help if needed.
---
local usage = 'usage is: --file=<path to this scripts/changes.lua> changes'
if #_ARGS ~= 0 then
error(usage, 0)
end

View File

@ -140,7 +140,7 @@
-- Bootstrap Premake in the newly cloned repository
--
print("Bootstraping Premake...")
print("Bootstrapping Premake...")
if compilerIsVS then
z = os.execute("Bootstrap.bat " .. compiler)
else
@ -184,6 +184,7 @@ if kind == "source" then
"clean",
"embed",
"package",
"self-test",
"test",
"gmake", -- deprecated
}
@ -247,8 +248,7 @@ end
--
-- Create a binary package for this platform. This step requires a working
-- GNU/Make/GCC environment. I use MinGW on Windows as it produces the
-- smallest binaries.
-- GNU/Make/GCC environment.
--
if kind == "binary" then