Skip to content

Commit

Permalink
fix: Use outputs for Buf plugin workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenh committed May 28, 2022
1 parent 3ccaf89 commit cdf2835
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
CI: true

release:
id: release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [build]
Expand All @@ -62,10 +63,13 @@ jobs:
- name: Build
run: yarn build
- name: Release
id: release
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
outputs:
release_version: ${{ steps.release.outputs.release_version }}

push_to_buf_registry:
name: Push Docker image to Buf Registry
Expand All @@ -86,8 +90,8 @@ jobs:
- name: Build Plugin image
run: docker build
--file ts-proto.Dockerfile
--tag plugins.buf.build/${{ secrets.BUF_USERNAME }}/ts-proto:${{ env.RELEASE_VERSION }}-0
--tag plugins.buf.build/${{ secrets.BUF_USERNAME }}/ts-proto:${{ needs.release.outputs.release_version }}-0
"."

- name: Push to Buf Registry
run: docker push plugins.buf.build/${{ secrets.BUF_USERNAME }}/ts-proto:${{ env.RELEASE_VERSION }}-0
run: docker push plugins.buf.build/${{ secrets.BUF_USERNAME }}/ts-proto:${{ needs.release.outputs.release_version }}-0
2 changes: 1 addition & 1 deletion release.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
'@semantic-release/npm',
'@semantic-release/github',
'@semantic-release/git',
['@semantic-release/exec', { publishCmd: 'echo "RELEASE_VERSION=${nextRelease.version}" >> $GITHUB_ENV' }],
['@semantic-release/exec', { publishCmd: 'echo "::set-output name=release_version::${nextRelease.version}"' }],
],
};

0 comments on commit cdf2835

Please sign in to comment.