From a7c1cd5372a32331fa4727c5b475b009ef248ae8 Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Tue, 2 May 2023 14:02:02 -0400 Subject: [PATCH 1/4] Update plugin reference --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 3f43bc0a9..392d800d6 100644 --- a/README.markdown +++ b/README.markdown @@ -110,7 +110,7 @@ You can also use the official plugin published to the Buf Registry. ```yaml version: v1 plugins: - - remote: buf.build/stephenh/plugins/ts-proto + - remote: buf.build/community/stephenh-ts-proto out: ../gen/ts opt: - outputServices=... From 86d5753d97ad976143ad0da48d320eff46aa5eff Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Tue, 2 May 2023 14:04:42 -0400 Subject: [PATCH 2/4] Also update the plugin key --- README.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.markdown b/README.markdown index 392d800d6..4402cd299 100644 --- a/README.markdown +++ b/README.markdown @@ -110,7 +110,7 @@ You can also use the official plugin published to the Buf Registry. ```yaml version: v1 plugins: - - remote: buf.build/community/stephenh-ts-proto + - plugin: buf.build/community/stephenh-ts-proto out: ../gen/ts opt: - outputServices=... From 0717d5d0a9b8cdbde4765a1d90cb310ec6d5e1bb Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Tue, 2 May 2023 14:52:25 -0400 Subject: [PATCH 3/4] Remove Dockerfile and push to buf job --- .github/workflows/build.yml | 26 -------------------------- ts-proto.Dockerfile | 24 ------------------------ 2 files changed, 50 deletions(-) delete mode 100644 ts-proto.Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a52b51049..bbbb50d73 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,29 +69,3 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} outputs: release_version: ${{ steps.release.outputs.release_version }} - - push_to_buf_registry: - if: ${{ needs.release.outputs.release_version != '' }} - name: Push Docker image to Buf Registry - runs-on: ubuntu-latest - environment: npm - needs: [release] - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - 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 - run: docker build - --file ts-proto.Dockerfile - --tag plugins.buf.build/community/stephenh-ts-proto:v${{ needs.release.outputs.release_version }}-0 - "." - - - name: Push to Buf Registry - run: docker push plugins.buf.build/community/stephenh-ts-proto:v${{ needs.release.outputs.release_version }}-0 diff --git a/ts-proto.Dockerfile b/ts-proto.Dockerfile deleted file mode 100644 index 0f43291d0..000000000 --- a/ts-proto.Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM node:17-alpine as build - -WORKDIR /ts-proto -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 workspaces focus --production - -FROM node:17-alpine - -WORKDIR /ts-proto -COPY --from=build /ts-proto/build build -COPY --from=build /ts-proto/node_modules node_modules -COPY protoc-gen-ts_proto . - -ENTRYPOINT ["./protoc-gen-ts_proto"] From 0660cd0216e837bd7f3b959eb626a6782532f4e5 Mon Sep 17 00:00:00 2001 From: Mike Fridman Date: Tue, 2 May 2023 16:30:48 -0400 Subject: [PATCH 4/4] revert ts-proto.Dockerfile --- ts-proto.Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ts-proto.Dockerfile diff --git a/ts-proto.Dockerfile b/ts-proto.Dockerfile new file mode 100644 index 000000000..0f43291d0 --- /dev/null +++ b/ts-proto.Dockerfile @@ -0,0 +1,24 @@ +FROM node:17-alpine as build + +WORKDIR /ts-proto +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 workspaces focus --production + +FROM node:17-alpine + +WORKDIR /ts-proto +COPY --from=build /ts-proto/build build +COPY --from=build /ts-proto/node_modules node_modules +COPY protoc-gen-ts_proto . + +ENTRYPOINT ["./protoc-gen-ts_proto"]