Skip to content

Content workflow

Content workflow #881

Workflow file for this run

name: ci
on:
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- uses: actions/cache@v3
with:
path: |
./.yarn
'**/node_modules'
key: ${{ runner.os }}-yarn
- run: yarn
- if: startsWith(github.ref, 'refs/tags/v')
run: |
yarn bump ${GITHUB_REF#refs/tags/v}
- run: yarn build
- run: yarn test
- if: startsWith(github.ref, 'refs/tags/v')
run: |
npm config set //registry.npmjs.org/:_authToken ${{secrets.NPM_AUTH_TOKEN}}
npm publish --access public --tolerate-republish -ws
release:
needs: ci
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
with:
changelog_file: changelog.md
- name: Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
body: ${{ steps.extract-release-notes.outputs.release_notes }}