Merge pull request #7 from tsxper/6-keywords-tags #4
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: Publish Package to npmjs | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Install dependencies | |
run: yarn install | |
- run: yarn build | |
- run: yarn test:ci | |
- run: yarn prepub | |
- run: yarn e2e | |
- run: yarn pub | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Get tag | |
id: get_tag | |
run: | | |
echo "version=v$(npm pkg get version | tr -d '\"')" >> $GITHUB_OUTPUT | |
- name: Tag the commit | |
run: | | |
next_version=${{ steps.get_tag.outputs.version }} | |
git tag -a "$next_version" -m "V $next_version" | |
git push origin "$next_version" |