Fix and test choco action (#911)

* ci(choco): fix action

Signed-off-by: hackercat <me@hackerc.at>

* fix(editorconfig): force style for all files, fix typo

Signed-off-by: hackercat <me@hackerc.at>

* ci(choco): test choco action

Signed-off-by: hackercat <me@hackerc.at>

* fix(editorconfig): unformat Dockerfile/sh

Signed-off-by: hackercat <me@hackerc.at>
This commit is contained in:
Ryan 2021-12-08 19:49:33 +01:00 committed by GitHub
parent b910a42edf
commit a545ceaec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 15 deletions

View file

@ -5,12 +5,17 @@ end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
# Override for Makefile
[{Makefile, makefile, GNUmakefile}]
indent_style = tab
indent_size = 4
[*.{yml.yaml,json}]
[*.sh]
indent_style = space
indent_size = 2
[Dockerfile]
indent_style = unset
indent_size = unset
[*.{yml,yaml,json}]
indent_style = space
indent_size = 2

View file

@ -2,18 +2,19 @@ FROM alpine:latest
ARG CHOCOVERSION=0.11.3
RUN apk add --no-cache bash ca-certificates \
&& apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing add mono-dev \
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" \
&& tar -xzf "${CHOCOVERSION}.tar.gz" \
&& mv "choco-${CHOCOVERSION}" /opt/chocolatey \
&& 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 \
&& ln -sf /opt /opt/chocolatey/opt \
&& mv ./code_drop/chocolatey/console /opt/chocolatey \
&& mkdir -p /opt/chocolatey/lib \
&& apk del ca-certificates \
&& 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"]

View file

@ -3,10 +3,14 @@ description: 'Create the choco package and push it'
inputs:
version:
description: 'Version of package'
required: true
required: false
apiKey:
description: 'API Key for chocolately'
required: true
required: false
push:
description: 'Option for if package is going to be pushed'
required: false
default: 'false'
runs:
using: 'docker'
image: 'Dockerfile'

View file

@ -3,7 +3,7 @@
set -e
function choco {
mono /opt/chocolatey/code_drop/chocolatey/choco.exe "$@" --allow-unofficial --nocolor
mono /opt/chocolatey/choco.exe "$@" --allow-unofficial --nocolor
}
function get_version {
@ -26,4 +26,6 @@ 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
if [[ "$INPUT_PUSH" == "true" ]]; then
choco push act-cli.${VERSION}.nupkg --api-key ${INPUT_APIKEY} -s https://push.chocolatey.org/ --timeout 180
fi

View file

@ -149,3 +149,7 @@ jobs:
with:
name: act-macos-arm64
path: dist/act_darwin_arm64/act
- name: Chocolatey
uses: ./.github/actions/choco
with:
version: v0.0.0-pr

View file

@ -37,3 +37,4 @@ jobs:
with:
version: ${{ github.ref }}
apiKey: ${{ secrets.CHOCO_APIKEY }}
push: true