Publish on tag #129
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
--- | |
name: Post merge build step | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
pull_request: ~ | |
jobs: | |
protobuf-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- uses: actions/setup-go@v3 | |
- name: Build | |
run: | | |
make clean | |
make init | |
make all | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: auto build commit | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check if tag | |
id: check_tag | |
run: | | |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then | |
echo "is_tag=true" >> $GITHUB_ENV | |
else | |
echo "is_tag=false" >> $GITHUB_ENV | |
fi | |
- name: Publish to npm | |
if: env.is_tag == 'true' | |
run: | | |
yarn | |
yarn build | |
yarn publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |