Skip to content

Commit

Permalink
Update chocolatey spec file and publish nupkg in github releases (cro…
Browse files Browse the repository at this point in the history
  • Loading branch information
blotus authored Oct 20, 2022
1 parent bb2f0e9 commit 03c9216
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ crowdsec-v*
pkg/cwhub/hubdir/.index.json
msi
*.msi
*.nukpg
**/*.nupkg
*.tgz
19 changes: 18 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ stages:
SecretsFilter: 'CodeSigningUser,CodeSigningPassword'
RunAsPreJob: false

- task: DownloadSEcureFile@1
- task: DownloadSecureFile@1
inputs:
secureFile: appsettings.json

Expand All @@ -68,6 +68,15 @@ stages:
displayName: "Build Crowdsec MSI"
name: BuildMSI
- pwsh: |
$build_version=(git describe --tags (git rev-list --tags --max-count=1)).Substring(1)
if ($build_version.Contains("-"))
{
$build_version = $build_version.Substring(0, $build_version.IndexOf("-"))
}
.\make_chocolatey.ps1 -version $build_version
displayName: "Build Chocolatey nupkg"
- pwsh: |
SignClient.exe Sign --name "crowdsec-msi" `
--input "*.msi" --config (Join-Path -Path $(Agent.TempDirectory) -ChildPath "appsettings.json") `
Expand All @@ -80,6 +89,13 @@ stages:
ArtifactName: 'crowdsec.msi'
publishLocation: 'Container'
displayName: "Upload MSI artifact"

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.Repository.LocalPath)\\windows\\Chocolatey\\crowdsec\\crowdsec.$(BuildMSI.BuildVersion).nupkg'
ArtifactName: 'crowdsec.nupkg'
publishLocation: 'Container'
displayName: "Upload nupkg artifact"
- stage: Publish
dependsOn: Build
jobs:
Expand All @@ -106,4 +122,5 @@ stages:
#the .. is an ugly hack, but I can't find the var that gives D:\a\1 ...
assets: |
$(Build.ArtifactStagingDirectory)\..\crowdsec.msi/*.msi
$(Build.ArtifactStagingDirectory)\..\crowdsec.nupkg/*.nupkg
condition: ne(variables['GetLatestPrelease.LatestPreRelease'], '')
2 changes: 1 addition & 1 deletion make_chocolatey.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ if ($version.Contains("-"))
Set-Location .\windows\Chocolatey\crowdsec
Copy-Item ..\..\..\crowdsec_$version.msi tools\crowdsec.msi

choco pack
choco pack --version $version
6 changes: 4 additions & 2 deletions windows/Chocolatey/crowdsec/crowdsec.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>crowdsec</id>
<version>1.3.3</version>
<!-- The version is set by the version argument of choco pack, so we just specify a dummy version here -->
<version>0.0.1</version>
<packageSourceUrl>https://github.com/crowdsecurity/crowdsec</packageSourceUrl>
<owners>CrowdSecurity</owners>
<!-- ============================== -->
Expand All @@ -13,11 +14,12 @@
<authors>CrowdSecurity</authors>
<projectUrl>https://crowdsec.net/</projectUrl>
<copyright>CrowdSec, 2022</copyright>
<licenseUrl>https://github.com/crowdsecurity/crowdsec/blob/main/LICENSE</licenseUrl>
<licenseUrl>https://github.com/crowdsecurity/crowdsec/blob/master/LICENSE</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<projectSourceUrl>https://github.com/crowdsecurity/crowdsec</projectSourceUrl>
<docsUrl>https://docs.crowdsec.net</docsUrl>
<bugTrackerUrl>https://github.com/crowdsecurity/crowdsec/issues</bugTrackerUrl>
<iconUrl>https://cdn.jsdelivr.net/gh/crowdsecurity/crowdsec-docs@c7b90095cca0007652f22c5c6d945c3416df4693/crowdsec-docs/static/img/crowdsec_no_txt.png</iconUrl>
<tags>crowdsec crowdsecurity security ips ids</tags>
<summary>CrowdSec IDS</summary>
<description>
Expand Down

0 comments on commit 03c9216

Please sign in to comment.