diff --git a/Dockerfile b/Dockerfile index bd8853b..8841193 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6-alpine +FROM ruby:2.7-alpine RUN apk add --no-cache git diff --git a/action.yml b/action.yml index ccee90b..d411161 100644 --- a/action.yml +++ b/action.yml @@ -11,9 +11,13 @@ inputs: owner: description: 'Name of the user or organization account that owns the repository containing your project.' required: true + working-directory: + description: 'An optional path to switch to before building the Gem.' + required: false runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.token }} - ${{ inputs.owner }} + - ${{ inputs.working-directory }} diff --git a/entrypoint.sh b/entrypoint.sh index 4576fa9..4f53bf0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,7 @@ GITHUB_TOKEN=$1 OWNER=$2 +WORKING_DIRECTORY=$3 [ -z "${GITHUB_TOKEN}" ] && { echo "Missing input.token!"; exit 2; } [ -z "${OWNER}" ] && { echo "Missing input.owner!"; exit 2; } @@ -13,6 +14,6 @@ chmod 600 ~/.gem/credentials echo ":github: Bearer ${GITHUB_TOKEN}" >> ~/.gem/credentials echo "Building the gem" -gem build *.gemspec +gem build ${WORKING_DIRECTORY:-.}/*.gemspec echo "Pushing the built gem to GitHub Package Registry" -gem push --key github --host "https://rubygems.pkg.github.com/${OWNER}" *.gem +gem push --key github --host "https://rubygems.pkg.github.com/${OWNER}" ./*.gem