Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
#1029 update chocolatey packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sawilde committed Jun 1, 2021
1 parent 06dbc26 commit 614e765
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 55 deletions.
26 changes: 16 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,22 @@ test: off
artifacts:
- path: main/bin/installer/*.msi
name: Installer
- path: main/bin/installer/*.txt
name: InstallerHash
- path: main/bin/zip/*.zip
name: ZipArchive
- path: main/bin/zip/*.txt
name: ZipArchiveHash
- path: main/bin/packages/nuget/opencover/*.nupkg
name: Nuget
- path: main/bin/packages/nuget/opencover-rc/*.nupkg
name: NugetCandidate
- path: main/bin/packages/chocolatey/opencover/*.nupkg
name: Chocolatey
- path: main/bin/packages/chocolatey/opencover.portable/*.nupkg
name: ChocolateyPortable
- path: main/bin/packages/chocolatey/opencover.install/*.nupkg
name: ChocolateyInstall
- path: main/bin/packages/chocolatey/opencover.portable/*.nupkg
name: ChocolateyPortable
- path: cov-int/build-log.txt
name: Coverity
- path: GenericCoverage.xml
Expand Down Expand Up @@ -108,6 +112,14 @@ deploy:
artifact: ChocolateyPortable
on:
branch: release
- provider: NuGet
server: https://chocolatey.org/
api_key:
secure: BbmHnhpI/e+m2xmR/5jxmOqKbQdcYG8RuF7iWT86SbCLIxPhMotbHprgBtw8dA4n
skip_symbols: true
artifact: ChocolateyInstall
on:
branch: release
- provider: NuGet
api_key:
secure: pIYB18F1Lfq/UWtYjWH1CaKuuLc2dLHxeRwH5xO3BZsv4pMce5ETtqglUWa96TWp
Expand All @@ -120,7 +132,7 @@ deploy:
release: OpenCover (Release Candidiate) $(appveyor_build_version)
auth_token:
secure: T8hG3PcjoJoYaCr7ND6wFfzJdje9TYqbvBl9pFmh3EmI6relJrXzAGAooe9lBYjt
artifact: Installer, ZipArchive
artifact: Installer, ZipArchive, InstallerHash, ZipArchiveHash
prerelease: true
on:
branch: rc
Expand All @@ -129,7 +141,7 @@ deploy:
release: OpenCover (Release) $(appveyor_build_version)
auth_token:
secure: T8hG3PcjoJoYaCr7ND6wFfzJdje9TYqbvBl9pFmh3EmI6relJrXzAGAooe9lBYjt
artifact: Installer, ZipArchive
artifact: Installer, ZipArchive, InstallerHash, ZipArchiveHash
on:
branch: release
- provider: NuGet
Expand All @@ -139,12 +151,6 @@ deploy:
artifact: NugetCandidate
on:
branch: master
notifications:
- provider: Webhook
url: https://webhooks.gitter.im/e/700bdb95a55f23095db9
on_build_success: true
on_build_failure: true
on_build_status_changed: true
on_success:
- ps: >-
if ($env:APPVEYOR_SCHEDULED_BUILD -ne "True" -and $env:APPVEYOR_REPO_BRANCH -ne "coverity")
Expand Down
119 changes: 75 additions & 44 deletions build/nuget_package.build
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
<property name="chocolatey.portable.output.folder" value="${solution.folder}\bin\packages\chocolatey\opencover.portable" />
<property name="checksum.exe" value="${choco.folder}/tools/checksum.exe" />

<target name="generate-release-notes" depends="get-version-number" >
<property
name="checksum.installer.output.file"
value="${solution.folder}\bin\installer\checksum.installer.txt" />

<property
name="checksum.zip.output.file"
value="${solution.folder}\bin\zip\checksum.zip.txt" />

<target name="generate-release-notes" depends="get-version-number" >
<delete file="ReleaseNotes.txt" />
<copy file="ReleaseNotes.tmp" tofile="ReleaseNotes.txt" >
<filterchain>
Expand Down Expand Up @@ -76,23 +84,12 @@
<exec program="${nuget.exe}"
commandline="pack ${solution.folder}\OpenCover.Packages\nuget\opencover\OpenCover.nuspec -BasePath ${root.folder} -OutputDirectory ${nugetpackage.folder} -Version ${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}${buildnumber.rc}" />
</target>

<target name="get-installer-checksum">
<property
name="checksum.output.file"
value="${solution.folder}\OpenCover.Packages\chocolatey\opencover\checksum.txt" />
<exec program="${checksum.exe}" output="${checksum.output.file}">
<arg value='-t:sha256' />
<arg value='-f="${solution.folder}\bin\installer\opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.msi"' />
</exec>
<loadfile
file="${checksum.output.file}"
property="checksum" />
<delete file="${checksum.output.file}" />
</target>

<target name="chocolatey-package" depends="get-version-number, get-installer-checksum" >


<target name="chocolatey-package-all"
depends="chocolatey-package, chocolatey-package-install, chocolatey-package-portable" />

<target name="chocolatey-package" depends="get-version-number" >

<property name="buildnumber.rc" value="${buildnumber.ci}" if="${property::exists('buildnumber.ci')}"/>
<property name="buildnumber.rc" value="" unless="${property::exists('buildnumber.rc')}"/>

Expand All @@ -102,62 +99,96 @@
<exec program="${choco.exe}"
commandline="pack ${solution.folder}\OpenCover.Packages\chocolatey\opencover\OpenCover.nuspec --Version=${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />

<move todir="${chocolatey.output.folder}" >
<move todir="${chocolatey.output.folder}" flatten="true" >
<fileset basedir=".">
<include name="*.nupkg" />
<include name="*.nupkg" />
</fileset>
</move>

</target>

<target name="get-zip-checksum">
<property
name="checksum.output.file"
value="${solution.folder}\OpenCover.Packages\chocolatey\opencover\checksum.txt" />
<exec program="${checksum.exe}" output="${checksum.output.file}">

<target name="get-installer-checksum">

<exec program="${checksum.exe}" output="${checksum.installer.output.file}">
<arg value='-t:sha256' />
<arg value='-f="${solution.folder}\bin\zip\opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.zip"' />
<arg value='-f="${solution.folder}\bin\installer\opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.msi"' />
</exec>

<loadfile
file="${checksum.output.file}"
property="checksum" />
<delete file="${checksum.output.file}" />
file="${checksum.installer.output.file}"
property="checksum.installer" />

<property name="checksum.installer"
value="${string::trim(checksum.installer)}" />

<echo message="Installer CheckSum is '${checksum.installer}'" />

<exec program="${checksum.exe}">
<arg value='-t:sha256' />
<arg value='-c:${checksum.installer}' />
<arg value='-f="${solution.folder}\bin\installer\opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.msi"' />
</exec>

</target>

<target name="chocolatey-package-portable" depends="get-version-number, get-zip-checksum" >
<target name="chocolatey-package-install" depends="get-version-number, get-installer-checksum" >

<delete file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\tools\chocolateyInstall.ps1" />
<copy file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\tools\chocolateyInstall.ps1.tmp" tofile="${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\tools\chocolateyInstall.ps1" >
<delete file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\tools\chocolateyInstall.ps1" />
<copy file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\tools\chocolateyInstall.ps1.tmp" tofile="${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\tools\chocolateyInstall.ps1" >
<filterchain>
<replacestring from="[[version]]" to="${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />
<replacestring from="[[checksum]]" to="${string::trim(checksum)}" />
<replacestring from="[[checksum]]" to="${checksum.installer}" />
</filterchain>
</copy>

<property name="buildnumber.rc" value="${buildnumber.ci}" if="${property::exists('buildnumber.ci')}"/>
<property name="buildnumber.rc" value="" unless="${property::exists('buildnumber.rc')}"/>

<mkdir dir="${chocolatey.output.folder}" />
<mkdir dir="${chocolatey.install.output.folder}" />
<mkdir dir="${choco.folder}\lib" />

<exec program="${choco.exe}"
commandline="pack ${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\OpenCover.portable.nuspec --Version=${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />
commandline="pack ${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\openCover.install.nuspec --Version=${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />

<move todir="${chocolatey.portable.output.folder}" >
<move todir="${chocolatey.install.output.folder}" flatten="true" >
<fileset basedir=".">
<include name="*.nupkg" />
</fileset>
</move>

</target>

<target name="chocolatey-package-install" depends="get-version-number, get-zip-checksum" >
<target name="get-zip-checksum">

<exec program="${checksum.exe}" output="${checksum.zip.output.file}">
<arg value='-t:sha256' />
<arg value='-f="${solution.folder}\bin\zip\opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.zip"' />
</exec>

<loadfile
file="${checksum.zip.output.file}"
property="checksum.zip" />

<property name="checksum.zip"
value="${string::trim(checksum.zip)}" />

<echo message="Installer CheckSum is '${checksum.zip}'" />

<exec program="${checksum.exe}" >
<arg value='-t:sha256' />
<arg value='-c:${checksum.zip}' />
<arg value='-f="${solution.folder}\bin\zip\opencover.${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}.zip"' />
</exec>

</target>

<target name="chocolatey-package-portable" depends="get-version-number, get-zip-checksum" >

<delete file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\tools\chocolateyInstall.ps1" />
<copy file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\tools\chocolateyInstall.ps1.tmp" tofile="${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\tools\chocolateyInstall.ps1" >
<delete file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\tools\chocolateyInstall.ps1" />
<copy file="${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\tools\chocolateyInstall.ps1.tmp" tofile="${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\tools\chocolateyInstall.ps1" >
<filterchain>
<replacestring from="[[version]]" to="${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />
<replacestring from="[[checksum]]" to="${string::trim(checksum)}" />
<replacestring from="[[checksum]]" to="${checksum.zip}" />
</filterchain>
</copy>

Expand All @@ -168,10 +199,10 @@
<mkdir dir="${choco.folder}\lib" />

<exec program="${choco.exe}"
commandline="pack ${solution.folder}\OpenCover.Packages\chocolatey\opencover.install\OpenCover.install.nuspec --Version=${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />
commandline="pack ${solution.folder}\OpenCover.Packages\chocolatey\opencover.portable\OpenCover.portable.nuspec --Version=${buildnumber.major}.${buildnumber.minor}.${buildnumber.build}" />

<move todir="${chocolatey.install.output.folder}" >
<fileset basedir=".">
<move todir="${chocolatey.portable.output.folder}" flatten="true">
<fileset basedir="." >
<include name="*.nupkg" />
</fileset>
</move>
Expand Down
Binary file modified main/.nuget/NuGet.exe
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>openCover.install</id>
<version>1.0.0.0</version>
<title>OpenCover - an open source code coverage tool for .NET</title>
<title>OpenCover (Installer) - an open source code coverage tool for .NET</title>
<authors>OpenCover, shaun wilde</authors>
<owners>shaun wilde</owners>
<licenseUrl>https://github.com/OpenCover/opencover/blob/master/LICENSE</licenseUrl>
Expand Down

0 comments on commit 614e765

Please sign in to comment.