-
Notifications
You must be signed in to change notification settings - Fork 874
Add Chocolatey publishing #4706
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
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,20 @@ | ||
FROM alpine:latest | ||
|
||
ARG CHOCOVERSION=1.1.0 | ||
|
||
RUN apk add --no-cache bash ca-certificates git \ | ||
&& apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono mono-dev \ | ||
&& cert-sync /etc/ssl/certs/ca-certificates.crt \ | ||
&& wget "https://github.com/chocolatey/choco/archive/${CHOCOVERSION}.tar.gz" -O- | tar -xzf - \ | ||
&& cd choco-"${CHOCOVERSION}" \ | ||
&& chmod +x build.sh zip.sh \ | ||
&& ./build.sh -v \ | ||
&& mv ./code_drop/chocolatey/console /opt/chocolatey \ | ||
&& mkdir -p /opt/chocolatey/lib \ | ||
&& rm -rf /choco-"${CHOCOVERSION}" \ | ||
&& apk del mono-dev \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
ENV ChocolateyInstall=/opt/chocolatey | ||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains hidden or 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,8 @@ | ||
VERIFICATION | ||
|
||
Verification is intended to assist the Chocolatey moderators and community | ||
in verifying that this package's contents are trustworthy. | ||
|
||
The installer has been downloaded from https://github.com/coder/coder/releases | ||
|
||
Checksums can be found in the coder_VERSION_checksums.txt at https://github.com/coder/coder/releases |
This file contains hidden or 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 @@ | ||
name: 'Chocolatey publish action' | ||
description: 'Creates package for Chocolatey and pushes it' | ||
inputs: | ||
version: | ||
description: 'Package version' | ||
required: false | ||
chocolateyKey: | ||
description: 'Chocolatey API key' | ||
required: false | ||
publish: | ||
description: 'Whether package should be published' | ||
required: false | ||
default: 'false' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
This file contains hidden or 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 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
function choco { | ||
mono /opt/chocolatey/choco.exe "$@" --allow-unofficial --nocolor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you switch to using the official Docker image, usage of |
||
} | ||
|
||
rm -f coder.*.nupkg | ||
|
||
mkdir -p tools | ||
cp LICENSE tools/LICENSE.txt | ||
cp VERIFICATION tools/VERIFICATION.txt | ||
sed -i "s/VERSION/${INPUT_VERSION}/g" tools/VERIFICATION.txt | ||
cp ./build/coder_*_windows_amd64.exe tools/ | ||
|
||
choco pack coder.nuspec --version "${INPUT_VERSION}" | ||
|
||
if [[ "$INPUT_PUBLISH" == "true" ]]; then | ||
choco push coder."${INPUT_VERSION}".nupkg --api-key="${INPUT_CHOCOLATEYKEY}" --source="https://push.chocolatey.org/" --timeout 180 | ||
fi |
This file contains hidden or 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 hidden or 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,29 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Do not remove this test for UTF-8: if “Ω” doesn’t appear as greek uppercase omega letter enclosed in quotation marks, you should use an editor that supports UTF-8, not this one. --> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd"> | ||
<metadata> | ||
<id>coder</id> | ||
<version>0.0.0</version> | ||
<packageSourceUrl>https://github.com/coder/coder</packageSourceUrl> | ||
<owners>coder</owners> | ||
<title>coder</title> | ||
<authors>coder</authors> | ||
<projectUrl>https://coder.com</projectUrl> | ||
<iconUrl>https://github.com/coder/presskit/raw/main/logos/coder%20logo%20black%20square.png</iconUrl> | ||
<copyright>Coder Technologies Inc</copyright> | ||
<licenseUrl>https://raw.githubusercontent.com/coder/coder/main/LICENSE</licenseUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<projectSourceUrl>https://github.com/coder/coder</projectSourceUrl> | ||
<docsUrl>https://coder.com/docs/coder-oss/latest</docsUrl> | ||
<bugTrackerUrl>https://github.com/coder/coder/issues</bugTrackerUrl> | ||
<tags>golang</tags> | ||
<summary>Software development on your infrastructure. Offload your team's development from local workstations to cloud servers. Onboard developers in minutes. Build, test and compile at the speed of the cloud. Keep your source code and data behind your firewall.</summary> | ||
<description>Software development on your infrastructure. Offload your team's development from local workstations to cloud servers. Onboard developers in minutes. Build, test and compile at the speed of the cloud. Keep your source code and data behind your firewall.</description> | ||
</metadata> | ||
<files> | ||
<file src="tools/**" target="tools" /> | ||
<file src="LICENSE" target="legal" /> | ||
<file src="LICENSE.enterprise" target="legal" /> | ||
<file src=".github/actions/chocolatey/VERIFICATION.txt" target="legal" /> | ||
</files> | ||
</package> |
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.
@ghuntley these steps shouldn't be necessary. Manually building Chocolatey is no longer required, as we ship a Docker Image ready to be used: https://hub.docker.com/u/chocolatey