Skip to content

Commit

Permalink
Convert chocolatey build to docker action
Browse files Browse the repository at this point in the history
  • Loading branch information
mpfz0r committed Dec 11, 2023
1 parent 2ac6ac6 commit 4c317a4
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ RUN chmod 777 /opt/chocolatey
RUN apt-get update \
&& apt-get install --no-install-recommends -y make \
&& apt-get clean

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
16 changes: 16 additions & 0 deletions .github/shared/docker-chocolatey/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Chocolatey docker action

This runs provided commands in a slightly modified chocolatey container.

## Inputs

## `command`

** Required ** The command to execute within the container


## Example usage

uses ./.github/shared/docker-chocolatey
with:
command: make package-chocolatey
15 changes: 15 additions & 0 deletions .github/shared/docker-chocolatey/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

name: 'Docker chocolatey action'
description: 'Runs commands in a slightly modified chocolatey container'

inputs:
command:
description: 'The command to exec'
required: true

runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.command }}

5 changes: 5 additions & 0 deletions .github/shared/docker-chocolatey/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh -l

echo "Running chocolatey docker action with args $@"

cd /github/workspace && exec $@
6 changes: 3 additions & 3 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ jobs:
CODESIGN_CREDENTIAL_ID: ${{ secrets.CODESIGN_CREDENTIAL_ID }}

- name: Chocolatey Pack
run: >
docker build -f docker/Dockerfile.chocolatey docker/ -t local/chocolatey &&
docker run --rm -v $(pwd):/root local/chocolatey make package-chocolatey
uses: ./.github/shared/docker-chocolatey
with:
command: make package-chocolatey

- name: Create checksums
run: cd dist/pkg && sha256sum * | tee CHECKSUMS-SHA256.txt
Expand Down

0 comments on commit 4c317a4

Please sign in to comment.