diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml deleted file mode 100644 index 647c26e4a..000000000 --- a/.github/workflows/buf.yml +++ /dev/null @@ -1,38 +0,0 @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93db7e9ad..183b7f557 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,10 @@ jobs: strategy: matrix: - node-version: [12.x, 14.x] + node-version: [14.x, 16.x] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 with: token: ${{ secrets.ADMIN_TOKEN }} - name: Use Node.js ${{ matrix.node-version }} @@ -50,13 +50,13 @@ jobs: needs: [build] steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: persist-credentials: false - name: Setup Node.js uses: actions/setup-node@v1 with: - node-version: 12.x + node-version: 16.x - name: Install run: yarn install - name: Build @@ -66,3 +66,29 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + push_to_buf_registry: + name: Push Docker image to Buf Registry + runs-on: ubuntu-latest + 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/${{ 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 diff --git a/package.json b/package.json index 48444a77b..17fb4a1be 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "@nestjs/microservices": "^8.2.2", "@semantic-release/changelog": "^5.0.1", "@semantic-release/commit-analyzer": "^8.0.1", + "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^9.0.0", "@semantic-release/github": "^7.2.0", "@semantic-release/npm": "^7.1.0", diff --git a/release.config.js b/release.config.js index fef96f307..e4448d7d2 100644 --- a/release.config.js +++ b/release.config.js @@ -7,5 +7,6 @@ module.exports = { '@semantic-release/npm', '@semantic-release/github', '@semantic-release/git', + ['@semantic-release/exec', { publishCmd: 'echo "RELEASE_VERSION=${nextRelease.version}" >> $GITHUB_ENV' }], ], }; diff --git a/yarn.lock b/yarn.lock index 72343c736..505f1ebcd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -894,6 +894,23 @@ resolved "https://registry.npmjs.org/@semantic-release/error/-/error-2.2.0.tgz" integrity sha512-9Tj/qn+y2j+sjCI3Jd+qseGtHjOAeg7dU2/lVcqIQ9TV3QDaDXDYXcoOHU+7o2Hwh8L8ymL4gfuO7KxDs3q2zg== +"@semantic-release/error@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@semantic-release/error/-/error-3.0.0.tgz#30a3b97bbb5844d695eb22f9d3aa40f6a92770c2" + integrity sha512-5hiM4Un+tpl4cKw3lV4UgzJj+SmfNIDCLLw0TepzQxz9ZGV5ixnqkzIVF+3tp0ZHgcMKE+VNGHJjEeyFG2dcSw== + +"@semantic-release/exec@^6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@semantic-release/exec/-/exec-6.0.3.tgz#d212fdf19633bdfb553de6cb6c7f8781933224db" + integrity sha512-bxAq8vLOw76aV89vxxICecEa8jfaWwYITw6X74zzlO0mc/Bgieqx9kBRz9z96pHectiTAtsCwsQcUyLYWnp3VQ== + dependencies: + "@semantic-release/error" "^3.0.0" + aggregate-error "^3.0.0" + debug "^4.0.0" + execa "^5.0.0" + lodash "^4.17.4" + parse-json "^5.0.0" + "@semantic-release/git@^9.0.0": version "9.0.0" resolved "https://registry.npmjs.org/@semantic-release/git/-/git-9.0.0.tgz"