Skip to content

Commit ff52831

Browse files
authored
Deploy only from release branch (#410)
* 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
1 parent c0da0c0 commit ff52831

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,19 @@
44

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

7-
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.
7+
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.
88

9-
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.
9+
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.
1010

11-
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.
11+
## Branches / tags
12+
13+
* `master` contains the latest sources - this is where we develop.
14+
* `release` contains the sources for the latest version on `nuget.org` - this is where we deploy from.
15+
* All versions on `nuget.org` have a matching GitHub release/tag
1216

1317
### Release workflow
1418

15-
1. Remove prelease suffix from `version.json`.
16-
1. Wait for the completion of the deployment.
17-
1. Remove the prerelease flag from the newly created GitHub release.
18-
1. Increment the version number in `version.json` and again add the prelease suffix (usually `beta` is fine).
19+
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.
20+
1. Inspect CI run (test results, version number)
21+
1. Merge PR and wait for deployment
22+
1. Inspect newly created package versions on NuGet.org and newly created GitHub release

appveyor.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ image:
44

55
configuration: Release
66

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

10+
# Don't start CI when tags are pushed
911
skip_tags: true
1012

13+
# Limit CI to master/release branches (and PRs targeting them)
1114
branches:
1215
only:
1316
- master
17+
- release
1418

1519
environment:
1620
INHERITDOC_VERSION: 1.2.2.1
@@ -31,6 +35,7 @@ before_package:
3135
# This step replaces the inheritdoc tags in the xml documentation with documentation from mscorlib.xml
3236
- 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'
3337

38+
# Perform deployments only for Windows job
3439
for:
3540
-
3641
matrix:
@@ -43,13 +48,13 @@ for:
4348
skip_symbols: false
4449
artifact: /.*\.nupkg/
4550
on:
46-
branch: master
51+
branch: release
4752

4853
- provider: GitHub
4954
tag: v$(appveyor_build_version)
50-
prerelease: true
55+
prerelease: false
5156
artifact: /.*\.nupkg/
5257
auth_token:
5358
secure: Rrk1zp93EpCyxec/GXKnRnJjX7vU+ClNZEBnxbM+1j6l+C56qSV7B/fUrVsJuZYV
5459
on:
55-
branch: master
60+
branch: release

version.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"precision": "major"
66
},
77
"publicReleaseRefSpec": [
8-
"^refs/heads/master$"
8+
"^refs/heads/release$"
99
],
1010
"cloudBuild": {
1111
"buildNumber": {
1212
"enabled": true,
1313
"setVersionVariables": true
1414
}
1515
}
16-
}
16+
}

0 commit comments

Comments
 (0)