Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish on tag #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions .github/workflows/on-release.yml

This file was deleted.

25 changes: 22 additions & 3 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ name: Post merge build step
on:
push:
branches:
- master
pull_request:

- master
tags:
- '*'
pull_request: ~
jobs:
protobuf-build:
runs-on: ubuntu-latest
Expand All @@ -28,3 +29,21 @@ jobs:
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 }}
5 changes: 1 addition & 4 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,5 @@ order to minimize the work. Just follow these steps:
- Commit the changes: `git commit package.json -m "@vocdoni/proto 1.2.3"`
- Tag the commit: `git tag v1.2.3`
- Push the ref and the tag: `git push origin master v1.2.3`
- Create a new github release: https://github.com/vocdoni/dvote-protobuf/releases/new?tag=v1.2.3

As soon as the github release is done, the github action will take care of the rest automatically: build the npm package and publish it on https://www.npmjs.com/package/@vocdoni/proto

TODO(gui): automate the release creation step, using the github action, triggered by the push of a tag
The publish to npmjs should be triggered by GH actions as soon as the new tag is detected.
Loading