-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement initial chocolatey packaging workflow #1400
Open
mikeee
wants to merge
7
commits into
dapr:master
Choose a base branch
from
mikeee:chocolatey-package-management
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
549f6fb
feat: implement initial chocolatey packaging workflow
mikeee a8b8db8
Merge branch 'master' into chocolatey-package-management
mikeee 1eb624d
fix: apply review suggestions
mikeee a15e0af
Merge branch 'master' into chocolatey-package-management
mikeee c2f7a2c
Merge branch 'master' into chocolatey-package-management
mikeee a4aa7d9
Merge branch 'master' into chocolatey-package-management
mikeee 51623fb
Merge branch 'master' into chocolatey-package-management
antontroshin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> | ||
<metadata> | ||
<id>dapr</id> | ||
<version>dapr_cli_version</version> | ||
<packageSourceUrl>https://github.com/dapr/cli/tree/master/.github/scripts/chocolatey</packageSourceUrl> | ||
<owners>mikeee, dapr</owners> | ||
<title>Dapr CLI (Install)</title> | ||
<authors>The Dapr Authors</authors> | ||
<projectUrl>https://dapr.io/</projectUrl> | ||
<iconUrl>https://cdn.jsdelivr.net/gh/dapr/website/static/images/dapr.svg</iconUrl> | ||
<copyright>Copyright 2024 The Dapr Authors</copyright> | ||
<licenseUrl>https://github.com/dapr/cli/blob/master/LICENSE</licenseUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<projectSourceUrl>https://github.com/dapr/cli</projectSourceUrl> | ||
<docsUrl>https://docs.dapr.io/reference/cli/cli-overview/</docsUrl> | ||
<bugTrackerUrl>https://github.com/dapr/cli/issues</bugTrackerUrl> | ||
<tags>dapr distributed application runtime cli kubernetes</tags> | ||
<summary>The Dapr CLI is the main tool for running Dapr-related tasks</summary> | ||
<description> | ||
The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernetes cluster, provides debugging support, and launches and manages Dapr instances. | ||
|
||
Dapr is a set of integrated APIs with built-in best practices and patterns to build distributed applications. Dapr increases your developer productivity by 20-40% with out-of-the-box features such as workflow, pub/sub, state management, secret stores, external configuration, bindings, actors, distributed lock, and cryptography. You benefit from the built-in security, reliability, and observability capabilities, so you don't need to write boilerplate code to achieve production-ready applications. | ||
</description> | ||
<releaseNotes>https://github.com/dapr/cli/releases</releaseNotes> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools"/> | ||
</files> | ||
</package> |
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,16 @@ | ||
$root = Join-Path "$(Split-Path -Parent $MyInvocation.MyCommand.Definition)" "install" | ||
$packageArgs = @{ | ||
packageName = $env:ChocolateyPackageName | ||
unzipLocation = $root | ||
fileType = 'msi' | ||
url64 = 'dapr_cli_url' | ||
checksum64 = 'dapr_cli_checksum' | ||
checksumType64= 'SHA256' | ||
|
||
silentArgs = '/qn /norestart' | ||
validExitCodes= @(0, 1641, 3010) | ||
|
||
} | ||
|
||
New-Item -ItemType Directory -Force -Path $root | Out-Null | ||
Install-ChocolateyPackage @packageArgs |
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,65 @@ | ||
name: release_chocolatey | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
daprcli_version: | ||
type: string | ||
description: "The Dapr CLI version to package (example: 1.13.0 or 1.13.0-rc1)" | ||
required: true | ||
workflow_dispatch: | ||
inputs: | ||
daprcli_version: | ||
description: "The Dapr CLI version to package (example: 1.13.0 or 1.13.0-rc1)" | ||
required: true | ||
|
||
jobs: | ||
publish: | ||
runs-on: windows-latest | ||
env: | ||
DAPR_CLI_VERSION: ${{ github.event.inputs.daprcli_version }} | ||
defaults: | ||
run: | ||
working-directory: .github/choco/ | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
||
# Get checksum file | ||
- name: Get checksum file | ||
shell: pwsh | ||
run: Invoke-WebRequest https://github.com/dapr/cli/releases/download/v1.13.0/dapr.msi.sha256 -OutFile dapr.msi.sha256 | ||
|
||
# Parse SHA256 from file | ||
- name: Parse SHA256 from file and write to $SHA256SUM | ||
shell: pwsh | ||
run: | | ||
$Env:SHA256SUM = (Get-Content dapr.msi.sha256 | foreach{$_.replace(" *dapr.msi", "")} | Set-Content -Path dapr.msi.sha256 | ||
echo "SHA256SUM=$env:SHA256SUM" >> $env:GITHUB_ENV | ||
|
||
# Update script url | ||
- name: Update install script url | ||
shell: pwsh | ||
run: Get-Content tools/chocolateyInstall.ps1 | foreach{$_.replace("dapr_cli_url", "https://github.com/dapr/cli/releases/download/v$env:DAPR_CLI_VERSION/dapr.msi")} | Set-Content -Path tools/chocolateyInstall.ps1 | ||
|
||
# Update script hash | ||
- name: Update install script hash | ||
shell: pwsh | ||
run: Get-Content tools/chocolateyInstall.ps1 | foreach{$_.replace("dapr_cli_checksum", "$env:SHA256SUM")} | Set-Content -Path tools/chocolateyInstall.ps1 | ||
|
||
# Update manifest version | ||
- name: Update manifest version | ||
shell: pwsh | ||
run: Get-Content dapr.nuspec | foreach{$_.replace("dapr_cli_version", "$env:DAPR_CLI_VERSION")} | Set-Content -Path dapr.nuspec | ||
|
||
# Use chocolatey to compile the repository into a nupkg | ||
- name: Compile package | ||
shell: pwsh | ||
run: choco pack | ||
|
||
# Publish package to the respository 'choco push' | ||
- name: Publish package to the community respository | ||
shell: pwsh | ||
env: | ||
CHOCOLATEY_TOKEN: ${{ secrets.CHOCOLATEY_TOKEN }} | ||
run: choco push -k $env:CHOCOLATEY_TOKEN |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the tools directory to .github/choco/tools? This will be consistent with
winget
.