mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Release templates (#4226)
* add creation of release templates to ci and update guide * touchups to markdown * correct create release property * correctly set fetch-depth and release body * fix replacements, remove arrows * check if there are no betas * add extra output * typo
This commit is contained in:
parent
0c54cdf6bc
commit
db528c6762
4 changed files with 223 additions and 72 deletions
76
.github/CONTRIBUTING.md
vendored
76
.github/CONTRIBUTING.md
vendored
|
|
@ -389,15 +389,10 @@ https://github.com/Cockatrice/Cockatrice/wiki/Translation-FAQ).
|
|||
|
||||
### Publishing A New Release ###
|
||||
|
||||
We use [GitHub Releases](https://github.com/Cockatrice/Cockatrice/releases) to publish
|
||||
new stable versions and betas:
|
||||
- GitHub Actions will upload binaries (**Linux & macOS**) when any release is published
|
||||
on GitHub.
|
||||
- AppVeyor will upload binaries (**Windows**) whenever a
|
||||
git "tag" is pushed to the repository.
|
||||
|
||||
To trigger both processes correctly you can publish a tagged (pre-)release right on GitHub,
|
||||
or create a tag manually first and use it for the (pre-)release creation afterwards.
|
||||
We use [GitHub Releases](https://github.com/Cockatrice/Cockatrice/releases) to
|
||||
publish new stable versions and betas.
|
||||
Whenever a git tag is pushed to the repository github will create a draft
|
||||
release and upload binaries automatically.
|
||||
|
||||
To create a tag, simply do the following:
|
||||
```bash
|
||||
|
|
@ -407,6 +402,7 @@ git pull
|
|||
git tag $TAG_NAME
|
||||
git push $UPSTREAM $TAG_NAME
|
||||
```
|
||||
|
||||
You should define the variables as such:
|
||||
```
|
||||
`$UPSTREAM` - the remote for git@github.com:Cockatrice/Cockatrice.git
|
||||
|
|
@ -416,16 +412,14 @@ You should define the variables as such:
|
|||
With *MAJ.MIN.PATCH* being the NEXT release version!
|
||||
```
|
||||
|
||||
>**Important:** You have to use the naming pattern `-beta` for the first beta release of one
|
||||
version, followed by `-beta.2`, `-beta.3` and counting...
|
||||
>This is crucial as Appveyor listens only for correct tags matching our defined pattern.
|
||||
|
||||
This will cause a tagged release to be established on the GitHub repository,
|
||||
which will then lead to the upload of binaries by AppVeyor.
|
||||
If you use a SemVer tag including "beta", the release that will be created at GitHub
|
||||
by AppVeyor will be marked as a "Pre-release" automatically.
|
||||
The target of the `.../latest` URL will not be changed in that case -
|
||||
it always points to the latest stable release and not pre-releases/betas.
|
||||
with the binaries being added to the release whenever they are ready.
|
||||
The release is initially a draft, where the path notes can be edited and after
|
||||
all is good and ready it can be published on GitHub.
|
||||
If you use a SemVer tag including "beta", the release that will be created at
|
||||
GitHub will be marked as a "Pre-release" automatically.
|
||||
The target of the `.../latest` URL will not be changed in that case, it always
|
||||
points to the latest stable release and not pre-releases/betas.
|
||||
|
||||
If you accidentally push a tag incorrectly (the tag is outdated, you didn't
|
||||
pull in the latest branch accidentally, you named the tag wrong, etc.) you can
|
||||
|
|
@ -434,32 +428,36 @@ revoke the tag by doing the following:
|
|||
git push --delete upstream $TAG_NAME
|
||||
git tag -d $TAG_NAME
|
||||
```
|
||||
You can also do this on GitHub, you'll also want to delete the new release.
|
||||
|
||||
**NOTE:** Unfortunately, due to the method of how AppVeyor works, to publish a
|
||||
stable release you will need to make a copy of the drafted release notes locally before
|
||||
pushing the tag, and paste them back into the GitHub releases GUI once the binaries have
|
||||
been uploaded by the CI.
|
||||
<br>
|
||||
The AppVeyor service will automatically overwrite the name of the release to
|
||||
"Cockatrice $TAG_NAME".
|
||||
In addition, for beta releases, the status of the release will be set to "Pre-release", and
|
||||
the release body will get renamed to "Beta build of Cockatrice".
|
||||
|
||||
**NOTE 2:** In the first lines of [CMakeLists.txt](
|
||||
In the first lines of [CMakeLists.txt](
|
||||
https://github.com/Cockatrice/Cockatrice/blob/master/CMakeLists.txt)
|
||||
there's an hardcoded version number used when compiling from master or custom (not tagged)
|
||||
versions. While on tagged versions these numbers are overridden by the version
|
||||
numbers coming from the tag title, it's good practice to increment the ones at CMake
|
||||
after every full release to stress that master is ahead of the last stable release.
|
||||
there's an hardcoded version number and pretty name used when compiling from
|
||||
master or custom (not tagged) versions.
|
||||
While on tagged versions these numbers are overridden by the version numbers
|
||||
coming from the tag title, it's good practice to increment the ones at CMake
|
||||
after every full release to stress that master is ahead of the last stable
|
||||
release.
|
||||
The preferred flow of operation is:
|
||||
* Just before a release, make sure the version number in CMakeLists.txt is set
|
||||
to the same release version you are about to tag.
|
||||
* Tag the release following the previously described syntax in order to get it correctly
|
||||
built and deployed by CI.
|
||||
* Wait for them to upload all binaries, then double check if everything is in order.
|
||||
* After the release is complete, update the CMake version number again to the next
|
||||
targeted beta version, typically increasing `PROJECT_VERSION_PATCH` by one.
|
||||
* This is also the time to change the pretty name in CMakeLists.txt called
|
||||
GIT_TAG_RELEASENAME and commit and push these changes.
|
||||
* Tag the release following the previously described syntax in order to get it
|
||||
correctly built and deployed by CI.
|
||||
* Wait for the configure step to create the release and update the patch
|
||||
notes.
|
||||
* Check on the github actions page for build progress which should be the top
|
||||
listed [here](
|
||||
https://github.com/Cockatrice/Cockatrice/actions?query=event%3Apush+-branch%3Amaster
|
||||
).
|
||||
* When the build has been completed you can verify all uploaded files on the
|
||||
release are in order and hit the publish button.
|
||||
* After the release is complete, update the CMake version number again to the
|
||||
next targeted beta version, typically increasing `PROJECT_VERSION_PATCH` by
|
||||
one.
|
||||
|
||||
**NOTE 3:** When releasing a new stable version, all previous beta releases (and tags)
|
||||
When releasing a new stable version, all previous beta releases (and tags)
|
||||
should be deleted. This is needed for Cockatrice to update users of the "Beta"
|
||||
release channel correctly to the latest stable version as well.
|
||||
This can be done the same way as revoking tags, mentioned above.
|
||||
|
|
|
|||
45
.github/workflows/ci-builds.yml
vendored
45
.github/workflows/ci-builds.yml
vendored
|
|
@ -22,9 +22,8 @@ jobs:
|
|||
|
||||
outputs:
|
||||
tag: ${{steps.configure.outputs.tag}}
|
||||
upload_url: ${{steps.create_release.outputs.upload_url}}
|
||||
is_beta: ${{steps.configure.outputs.is_beta}}
|
||||
sha: ${{steps.configure.outputs.sha}}
|
||||
upload_url: ${{steps.create_release.outputs.upload_url}}
|
||||
|
||||
steps:
|
||||
- name: Cancel previous runs
|
||||
|
|
@ -37,20 +36,12 @@ jobs:
|
|||
shell: bash
|
||||
run: |
|
||||
tag_regex='^refs/tags/'
|
||||
beta_regex='beta'
|
||||
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
|
||||
sha="${{github.event.pull_request.head.sha}}"
|
||||
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
|
||||
tag="${GITHUB_REF/refs\/tags\//}"
|
||||
sha="$GITHUB_SHA"
|
||||
tag="${GITHUB_REF/refs\/tags\//}"
|
||||
echo "::set-output name=tag::$tag"
|
||||
if [[ $tag =~ beta_regex ]]; then
|
||||
echo "::set-output name=is_beta::yes"
|
||||
else
|
||||
echo "::set-output name=is_beta::no"
|
||||
version="${tag##*-}"
|
||||
echo "::set-output name=version::$version"
|
||||
fi
|
||||
else # push to branch
|
||||
sha="$GITHUB_SHA"
|
||||
fi
|
||||
|
|
@ -59,29 +50,16 @@ jobs:
|
|||
- name: Checkout
|
||||
if: steps.configure.outputs.tag != null
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Create release title
|
||||
id: title
|
||||
- name: Prepare release paramaters
|
||||
id: prepare
|
||||
if: steps.configure.outputs.tag != null
|
||||
shell: bash
|
||||
run: |
|
||||
name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")'
|
||||
if [[ "${{steps.configure.outputs.is_beta}}" == "yes" ]]; then
|
||||
title="${{steps.configure.outputs.tag}}"
|
||||
echo "creating beta release '$title'"
|
||||
else
|
||||
if [[ $(cat CMakeLists.txt) =~ $name_regex ]]; then
|
||||
name="${BASH_REMATCH[1]}"
|
||||
version="${{steps.configure.outputs.version}}"
|
||||
title="Cockatrice $version: $name"
|
||||
echo "::set-output name=friendly_name::$name"
|
||||
echo "creating full release '$title'"
|
||||
else
|
||||
echo "::error::could not find releasename in CMakeLists.txt"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "::set-output name=title::$title"
|
||||
env:
|
||||
TAG: ${{steps.configure.outputs.tag}}
|
||||
run: .ci/prep_release.sh
|
||||
|
||||
- name: Create release
|
||||
if: steps.configure.outputs.tag != null
|
||||
|
|
@ -91,9 +69,10 @@ jobs:
|
|||
GITHUB_TOKEN: ${{github.token}}
|
||||
with:
|
||||
tag_name: ${{github.ref}}
|
||||
release_name: ${{steps.title.outputs.title}}
|
||||
release_name: ${{steps.prepare.outputs.title}}
|
||||
body_path: ${{steps.prepare.outputs.body_path}}
|
||||
draft: true
|
||||
prerelease: ${{steps.configure.outputs.is_beta == 'yes'}}
|
||||
prerelease: ${{steps.prepare.outputs.is_beta == 'yes'}}
|
||||
|
||||
build-linux:
|
||||
strategy:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue