Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,11 @@ jobs:
version: v1.3.2
- name: Assert Terraform on PATH
run: terraform --version

make-protos:
name: Testing Make Protos
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

16 changes: 16 additions & 0 deletions make-protos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Make Protobuf

This action is used to update protobufs for swift code

The directory parameter should be set to the place where the mprc files are downloaded
It is optional and defaults to "mrpc"

```yaml
- uses: lismondbernard/actions/make-protos@v1
with:
directory: "mrpc"
```

## Developing

This code is composite actions based mostly on bash scripts.
14 changes: 14 additions & 0 deletions make-protos/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Make Protos'
description: 'Generate protobuf files'
inputs:
directory: # directory of mrpc files
description: 'Directory of mrpc files'
required: true
default: 'mrpc'
runs:
using: "composite"
steps:
- run: echo "${{ github.workspace }}/${{ inputs.directory }}/bin" >> $GITHUB_PATH
shell: bash
- run: $GITHUB_ACTION_PATH/make-protos.sh "${{ inputs.directory }}"
shell: bash
21 changes: 21 additions & 0 deletions make-protos/make-protos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# Make Protos

#Check if MRPC tools have been downloaded
MRPC_DIR=$1

if [ -z $MRPC_DIR ]; then
MRPC_DIR="mrpc"
fi

if [ -d $MRPC_DIR ]; then
cd $MRPC_DIR
tar zxvf mrpc-darwin-amd64.tar.gz
echo $PATH
cd $GITHUB_WORKSPACE
make protos
git commit -am "make protos"
git push
else
echo "$MRPC_DIR does not exist"
fi