Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Commit e459c69

Browse files
Zack StevensZack Stevens
andauthored
fix: Initial release (#1)
Co-authored-by: Zack Stevens <[email protected]>
1 parent 5bb0e72 commit e459c69

File tree

3 files changed

+53
-32
lines changed

3 files changed

+53
-32
lines changed

CHANGELOG.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ Greet someone
3737
<!-- end outputs -->
3838
<!-- start examples -->
3939

40-
### Example usage
40+
### Example usage with npm upload protos action, will result in an uploaded package called `@unsupervised/my-app`
4141

4242
```yaml
43-
on: [push]
44-
43+
name: Build and upload npm protos to gar
44+
on:
45+
release:
46+
types: [created]
4547
jobs:
46-
hello_world_job:
48+
build-upload-protos-npm:
4749
runs-on: ubuntu-latest
48-
name: A job to say hello
4950
steps:
50-
- uses: actions/checkout@v2
51-
- id: foo
52-
uses: actions/hello-world-composite-action@v1
51+
- uses: Unsupervisedcom/action-buf-generate@v1
52+
- uses: Unsupervisedcom/action-upload-protos-npm-gar@v1
5353
with:
54-
who-to-greet: "Mona the Octocat"
55-
- run: echo random-number ${{ steps.foo.outputs.random-number }}
56-
shell: bash
54+
project-id: ${{ secrets.GOOGLE_ARTIFACT_PROJECT_ID }}
55+
credentials-json: ${{ secrets.GOOGLE_ARTIFACT_READ_WRITE }}
56+
package-name: 'my-app'
5757
```
5858

5959
<!-- end examples -->

action.yaml

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,48 @@
1-
name: 'Hello World' # taken from https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
2-
description: 'Greet someone'
1+
name: 'Buf generate'
2+
description: 'Uses Buf to generate compiled protos'
33
inputs:
4-
who-to-greet: # id of input
5-
description: 'Who to greet'
6-
required: true
7-
default: 'World'
8-
outputs:
9-
random-number:
10-
description: "Random number"
11-
value: ${{ steps.random-number-generator.outputs.random-id }}
4+
working-directory:
5+
description: Working directory
6+
required: false
7+
default: ${{ github.workspace }}
128
runs:
13-
using: "composite"
9+
using: composite
1410
steps:
15-
- run: echo Hello ${{ inputs.who-to-greet }}.
11+
- name: Install Buf
12+
uses: bufbuild/[email protected]
13+
with:
14+
version: '1.0.0-rc8'
15+
- name: Install Go
16+
uses: actions/setup-go@v2
17+
with:
18+
go-version: 1.17
19+
- name: Setup cache
20+
uses: actions/cache@v2
21+
with:
22+
# In order:
23+
# * go Module download cache
24+
# * go Build cache (Linux)
25+
path: |
26+
~/go/pkg/mod
27+
~/.cache/go-build
28+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
29+
restore-keys: |
30+
${{ runner.os }}-go-
31+
- name: Install Protoc
32+
uses: arduino/setup-protoc@v1
33+
with:
34+
repo-token: ${{ inputs.github-token }}
35+
- name: Install go dependencies
1636
shell: bash
17-
- id: random-number-generator
18-
run: echo "::set-output name=random-id::$(echo $RANDOM)"
37+
run: |
38+
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
39+
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
40+
- name: Install npm dependencies
1941
shell: bash
20-
- run: ${{ github.action_path }}/goodbye.sh
42+
run: |
43+
npm install grpc-tools grpc_tools_node_protoc_ts --global
44+
- name: Run buf generate
2145
shell: bash
46+
working-directory: ${{ inputs.working-directory }}
47+
run: |
48+
buf generate

0 commit comments

Comments
 (0)