forked from nektos/act
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 132 - support for chocolatey install (nektos#144)
* fix nektos#132 - publish chocolatey package for act * add missing files to pass validation * remove extra choco step
- Loading branch information
Showing
8 changed files
with
117 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
FROM mono:3.12.1 as builder | ||
ARG CHOCOVERSION=0.10.15 | ||
|
||
RUN echo "deb http://archive.debian.org/debian/ wheezy main contrib non-free" >/etc/apt/sources.list | ||
RUN apt-get update && apt-get install -y wget tar gzip | ||
|
||
WORKDIR /usr/local/src | ||
RUN wget "https://github.com/chocolatey/choco/archive/${CHOCOVERSION}.tar.gz" | ||
RUN tar -xzf "${CHOCOVERSION}.tar.gz" | ||
RUN mv "choco-${CHOCOVERSION}" choco | ||
|
||
WORKDIR /usr/local/src/choco | ||
RUN chmod +x build.sh zip.sh | ||
RUN ./build.sh -v | ||
|
||
FROM alpine:latest | ||
|
||
COPY --from=builder /usr/local/src/choco/build_output/chocolatey /opt/chocolatey | ||
|
||
RUN apk add --no-cache bash | ||
RUN apk --update --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono-dev \ | ||
&& apk --update --no-cache add -t build-dependencies ca-certificates \ | ||
&& cert-sync /etc/ssl/certs/ca-certificates.crt \ | ||
&& ln -sf /opt /opt/chocolatey/opt \ | ||
&& mkdir -p /opt/chocolatey/lib \ | ||
&& apk del build-dependencies \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
|
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,12 @@ | ||
name: 'Chocolatey Packager' | ||
description: 'Create the choco package and push it' | ||
inputs: | ||
version: | ||
description: 'Version of package' | ||
required: true | ||
apiKey: | ||
description: 'API Key for chocolately' | ||
required: true | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' |
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,29 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
function choco { | ||
mono /opt/chocolatey/choco.exe "$@" --allow-unofficial --nocolor | ||
} | ||
|
||
function get_version { | ||
local version=${INPUT_VERSION:-$(git describe --tags)} | ||
version=(${version//[!0-9.-]/}) | ||
local version_parts=(${version//-/ }) | ||
version=${version_parts[0]} | ||
if [ ${#version_parts[@]} -gt 1 ]; then | ||
version=${version_parts}.${version_parts[1]} | ||
fi | ||
echo "$version" | ||
} | ||
|
||
## Determine the version to pack | ||
VERSION=$(get_version) | ||
echo "Packing version ${VERSION} of act" | ||
rm -f act-cli.*.nupkg | ||
mkdir -p tools | ||
cp LICENSE tools/LICENSE.txt | ||
cp VERIFICATION tools/VERIFICATION.txt | ||
cp dist/act_windows_amd64/act.exe tools/ | ||
choco pack act-cli.nuspec --version ${VERSION} | ||
choco push act-cli.${VERSION}.nupkg --api-key ${INPUT_APIKEY} -s https://push.chocolatey.org/ --timeout 180 |
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 |
---|---|---|
|
@@ -12,4 +12,6 @@ | |
*.out | ||
|
||
dist/ | ||
.todo | ||
.todo | ||
|
||
*.nupkg |
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,5 @@ | ||
VERIFICATION | ||
Verification is intended to assist the Chocolatey moderators and community | ||
in verifying that this package's contents are trustworthy. | ||
|
||
Checksums: https://github.com/nektos/act/releases, in the checksums.txt file |
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,26 @@ | ||
<?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>act-cli</id> | ||
<version>0.0.0</version> | ||
<packageSourceUrl>https://github.com/nektos/act</packageSourceUrl> | ||
<owners>nektos</owners> | ||
<title>act (GitHub Actions CLI)</title> | ||
<authors>nektos</authors> | ||
<projectUrl>https://github.com/nektos/act</projectUrl> | ||
<iconUrl>https://raw.githubusercontent.com/wiki/nektos/act/img/logo-150.png</iconUrl> | ||
<copyright>Nektos</copyright> | ||
<licenseUrl>https://raw.githubusercontent.com/nektos/act/master/LICENSE</licenseUrl> | ||
<requireLicenseAcceptance>true</requireLicenseAcceptance> | ||
<projectSourceUrl>https://github.com/nektos/act</projectSourceUrl> | ||
<docsUrl>https://raw.githubusercontent.com/nektos/act/master/README.md</docsUrl> | ||
<bugTrackerUrl>https://github.com/nektos/act/issues</bugTrackerUrl> | ||
<tags>act github-actions actions golang ci devops</tags> | ||
<summary>Run your GitHub Actions locally 🚀</summary> | ||
<description>Run your GitHub Actions locally 🚀</description> | ||
</metadata> | ||
<files> | ||
<file src="tools/**" target="tools" /> | ||
</files> | ||
</package> |