Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(build): semantic-release now used for deployments
Using semantic-release for deployments based on conventional commits and Chocolatey deployments & GitHub Releases release notes
- Loading branch information
1 parent
ec654ef
commit affc1c7
Showing
5 changed files
with
87 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
branches: [ | ||
"master" | ||
], | ||
plugins: [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
["@semantic-release/exec", { | ||
"verifyConditionsCmd": "src\\.build\\semantic-release-verify.cmd", | ||
"prepareCmd": "src\\.build\\semantic-release-prepare.cmd ${nextRelease.version}", | ||
"publishCmd": "src\\.build\\semantic-release-publish.cmd ${nextRelease.version}", | ||
}], | ||
// github config docs: https://github.com/semantic-release/github | ||
["@semantic-release/github", { | ||
"assets": [ | ||
{"path": "src\\.deploy\\chocolateypackage\\*.nupkg", "label": "NuGet distribution"}, | ||
{"path": "src\\.deploy\\*.zip", "label": "ZIP distribution"} | ||
] | ||
}], | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@echo off | ||
|
||
REM This script called by semantic-release to "prepare" the build. | ||
REM Since semantic-release determines the version number based on commits, we rebuild it with the new version number: | ||
|
||
IF [%1]==[] ( | ||
ECHO ERROR: Must supply build version as first parameter to this bat file! 1>&2 | ||
EXIT 1 | ||
) | ||
set _BUILD_VERSION=%1 | ||
|
||
ECHO Running msbuild... | ||
|
||
msbuild .\src\.build\lessmsi.msbuild /p:TheVersion=%_BUILD_VERSION% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" | ||
|
||
REM NOTE: ECHO does not clear/set errorlevel https://ss64.com/nt/errorlevel.htmls | ||
ECHO Running msbuild complete. | ||
|
||
EXIT %ERRORLEVEL% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@echo off | ||
|
||
REM note: Nodejs configured and semantic-release insalled in appveyor.yml | ||
REM This script is called /by/ semantic-release to publish to chocolatey | ||
|
||
set THIS_DIR=%~dp0 | ||
|
||
IF [%1]==[] ( | ||
ECHO ERROR: Must supply build version as first parameter to this bat file! 1>&2 | ||
EXIT 1 | ||
) | ||
set _BUILD_VERSION=%1 | ||
|
||
ECHO Running choco push... | ||
|
||
choco push "%THIS_DIR%..\.deploy\chocolateypackage\lessmsi.%_BUILD_VERSION%.nupkg" --api-key=%CHOCO_KEY% | ||
|
||
REM NOTE: ECHO does not clear/set errorlevel https://ss64.com/nt/errorlevel.htmls | ||
ECHO Running choco push complete. Errorlevel was %ERRORLEVEL% | ||
|
||
EXIT %ERRORLEVEL% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@echo off | ||
|
||
IF DEFINED CHOCO_KEY ( | ||
echo "CHOCO_KEY is defined" | ||
EXIT 0 | ||
) ELSE ( | ||
echo "CHOCO_KEY is NOT defined" 1>&2 | ||
EXIT 1 | ||
) |