Skip to content

Commit

Permalink
Add working directory support
Browse files Browse the repository at this point in the history
This adds the option to change directory before building the gem.
Adds support for monorepos
  • Loading branch information
damacus committed Jun 3, 2020
1 parent 898b22e commit 2683ce9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.6-alpine
FROM ruby:2.7-alpine

RUN apk add --no-cache git

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
5 changes: 3 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand All @@ -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

0 comments on commit 2683ce9

Please sign in to comment.