diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dcf2f9a..3ba067f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 + diff --git a/make-protos/README.md b/make-protos/README.md new file mode 100644 index 0000000..9515210 --- /dev/null +++ b/make-protos/README.md @@ -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. diff --git a/make-protos/action.yml b/make-protos/action.yml new file mode 100644 index 0000000..d3d440a --- /dev/null +++ b/make-protos/action.yml @@ -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 diff --git a/make-protos/make-protos.sh b/make-protos/make-protos.sh new file mode 100755 index 0000000..76e56ae --- /dev/null +++ b/make-protos/make-protos.sh @@ -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