-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added CI workflow for publishing Buf plugin * Updated some integration files due to build:test * Updated buf.yml to utilize variables for plugin owner
- Loading branch information
1 parent
e4351d4
commit e6272c4
Showing
3 changed files
with
119 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Buf Plugin | ||
|
||
on: | ||
push: | ||
tags: | ||
- v*.*.* | ||
|
||
jobs: | ||
push_to_buf_registry: | ||
name: Push Docker image to Buf Registry | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set output | ||
id: vars | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Log in to Buf Plugin Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: plugins.buf.build | ||
username: ${{ secrets.BUF_USERNAME }} | ||
password: ${{ secrets.BUF_PASSWORD }} | ||
|
||
- name: Build Plugin image | ||
env: | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
run: docker build | ||
--file ts-proto.Dockerfile | ||
--tag plugins.buf.build/${{ secrets.BUF_USERNAME }}/ts-proto:${RELEASE_VERSION}-0 | ||
"." | ||
|
||
- name: Push to Buf Registry | ||
env: | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
run: docker push plugins.buf.build/${{ secrets.BUF_USERNAME }}/ts-proto:${RELEASE_VERSION}-0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM node:12-alpine as build | ||
|
||
COPY . . | ||
|
||
# Install all dependencies needed for production build | ||
RUN yarn install | ||
RUN yarn build | ||
|
||
# clean all depencies | ||
RUN rm -rf node_modules | ||
RUN yarn cache clean | ||
|
||
# install production dependencies only | ||
RUN yarn install --production | ||
|
||
FROM node:12-alpine | ||
|
||
WORKDIR /ts-proto | ||
|
||
COPY --from=build build build | ||
COPY --from=build node_modules node_modules | ||
COPY protoc-gen-ts_proto . | ||
|
||
ENTRYPOINT ["./protoc-gen-ts_proto"] |