Skip to content

Commit

Permalink
Deploy only from release branch (#410)
Browse files Browse the repository at this point in the history
* Deploy only from release branch

* Adapt version.json for deploy from release branch

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md

* Update appveyor.yml

* Add link to create release PR
  • Loading branch information
fgreinacher authored Dec 4, 2018
1 parent c0da0c0 commit ff52831
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
18 changes: 11 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@

This library uses [Nerdbank.GitVersioning](https://github.com/AArnott/Nerdbank.GitVersioning) for generating stable and reproducible version numbers.

The so-called base version is manually maintained in [the version config](version.json). Every build calculates its final version number based on the base version and the number of changes that occured since the last change to the version config.
The base version is manually maintained in [the version config](version.json). Every build calculates its final version number based on the base version and the number of changes that occured since the last change to the version config.

The base version represents the _next_ version that we will released. During development it contains a prerelease suffix, like `-beta` which is appended to the generated NuGet packages.
The base version represents the MAJOR and MINOR parts of [SemVer](https://semver.org). If a PR contains breaking changes or new features the base version has to be changed accordingly. If a PR solely contains minor changes (bug fixes, code improvements) nothing needs to be done as the PATCH number will automatically increment with each commit.

Every successful commit on `master` deploys packages to `nuget.org` and a creates GitHub release. As long as we have the prelease suffix both will be marked as such.
## Branches / tags

* `master` contains the latest sources - this is where we develop.
* `release` contains the sources for the latest version on `nuget.org` - this is where we deploy from.
* All versions on `nuget.org` have a matching GitHub release/tag

### Release workflow

1. Remove prelease suffix from `version.json`.
1. Wait for the completion of the deployment.
1. Remove the prerelease flag from the newly created GitHub release.
1. Increment the version number in `version.json` and again add the prelease suffix (usually `beta` is fine).
1. Create a [PR from `master` to `release`](https://github.com/System-IO-Abstractions/System.IO.Abstractions/compare/release...master?expand=1) and wait for CI to finish.
1. Inspect CI run (test results, version number)
1. Merge PR and wait for deployment
1. Inspect newly created package versions on NuGet.org and newly created GitHub release
11 changes: 8 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ image:

configuration: Release

# Don't start CI for branches that already have a PR
skip_branch_with_pr: true

# Don't start CI when tags are pushed
skip_tags: true

# Limit CI to master/release branches (and PRs targeting them)
branches:
only:
- master
- release

environment:
INHERITDOC_VERSION: 1.2.2.1
Expand All @@ -31,6 +35,7 @@ before_package:
# This step replaces the inheritdoc tags in the xml documentation with documentation from mscorlib.xml
- ps: '& $env:TEMP_DIR\InheritDoc.$env:INHERITDOC_VERSION\tools\InheritDoc.exe -b $env:APPVEYOR_BUILD_FOLDER -g "c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.X\mscorlib.xml" -o'

# Perform deployments only for Windows job
for:
-
matrix:
Expand All @@ -43,13 +48,13 @@ for:
skip_symbols: false
artifact: /.*\.nupkg/
on:
branch: master
branch: release

- provider: GitHub
tag: v$(appveyor_build_version)
prerelease: true
prerelease: false
artifact: /.*\.nupkg/
auth_token:
secure: Rrk1zp93EpCyxec/GXKnRnJjX7vU+ClNZEBnxbM+1j6l+C56qSV7B/fUrVsJuZYV
on:
branch: master
branch: release
4 changes: 2 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"precision": "major"
},
"publicReleaseRefSpec": [
"^refs/heads/master$"
"^refs/heads/release$"
],
"cloudBuild": {
"buildNumber": {
"enabled": true,
"setVersionVariables": true
}
}
}
}

0 comments on commit ff52831

Please sign in to comment.