Skip to content

unify ci

unify ci #7

Workflow file for this run

name: Publish package to npmjs
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'
- name: Configure git credentials
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "Github Actions"
- run: yarn version --patch
- run: yarn
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Push commits and tags
run: git push --follow-tags # `yarn` already commits and tags
- name: Get latest tag (added by yarn)
run: echo "TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: Create release
uses: actions/github-script@v6
with:
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: "${{ env.TAG }}",
generate_release_notes: true
})