Fix error in property params
of Segment
type
#141
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v* | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x, 22.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use NodeJS v${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install | |
run: npm ci | |
- name: Test | |
run: npm test | |
- name: Coverage | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./tests/coverage/lcov.info | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use NodeJS v20 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install | |
run: npm ci | |
- name: Lint | |
run: npm run lint | |
npm: | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: | |
- test | |
- lint | |
name: NPM Package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use NodeJS v16 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: npm ci | |
- name: Sanity check | |
run: | | |
npm run lint | |
npm test | |
- name: Deploy to NPM | |
uses: JS-DevTools/npm-publish@v3 | |
with: | |
token: ${{ secrets.NPM_TOKEN }} | |
release: | |
name: Release | |
needs: npm | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get tag metadata | |
id: tag | |
run: | | |
TAG_TITLE=${GITHUB_REF#refs/*/} | |
echo ::set-output name=title::$TAG_TITLE | |
git -c protocol.version=2 fetch --prune --progress \ | |
--no-recurse-submodules origin \ | |
+refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* | |
TAG_BODY="$(git tag -l --format='%(contents)' $TAG_TITLE)" | |
TAG_BODY="${TAG_BODY//'%'/'%25'}" | |
TAG_BODY="${TAG_BODY//$'\n'/'%0A'}" | |
TAG_BODY="${TAG_BODY//$'\r'/'%0D'}" | |
echo ::set-output name=body::$TAG_BODY | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ steps.tag.outputs.title }} | |
name: ${{ steps.tag.outputs.title }} | |
body: ${{ steps.tag.outputs.body }} | |
draft: false | |
prerelease: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |