File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Checking if current tag matches the package version
4+ current_tag=$( echo $GITHUB_REF | tr -d ' refs/tags/v' )
5+ file_tag=$( grep ' "version":' package.json | cut -d ' :' -f 2- | tr -d ' ' | tr -d ' "' | tr -d ' ,' )
6+ if [ " $current_tag " != " $file_tag " ]; then
7+ echo " Error: the current tag does not match the version in package file(s)."
8+ echo " $current_tag vs $file_tag "
9+ exit 1
10+ fi
11+
12+ echo ' OK'
13+ exit 0
Original file line number Diff line number Diff line change 1+ name : Publish to npm
2+ on :
3+ push :
4+ tags :
5+ - v*
6+
7+ jobs :
8+ publish-npm :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v2
12+ - uses : actions/setup-node@v1
13+ with :
14+ node-version : 12
15+ registry-url : https://registry.npmjs.org/
16+ - name : Check release validity
17+ run : sh .github/scripts/check-release.sh
18+ - name : Install dependencies
19+ run : yarn install
20+ - name : Build
21+ run : yarn build
22+ - name : Publish
23+ run : npm publish .
24+ env :
25+ NODE_AUTH_TOKEN : ${{secrets.NPM_TOKEN}}
Original file line number Diff line number Diff line change 1414</h4 >
1515
1616<p align =" center " >
17+ <a href =" https://www.npmjs.com/package/@meilisearch/instant-meilisearch " ><img src =" https://img.shields.io/npm/v/@meilisearch/instant-meilisearch.svg " alt =" npm version " ></a >
18+ <a href =" https://github.com/meilisearch/instant-meilisearch/actions " ><img src =" https://github.com/meilisearch/instant-meilisearch/workflows/Tests/badge.svg?branch=master " alt =" Tests " ></a >
19+ <a href =" https://github.com/meilisearch/instant-meilisearch/blob/master/LICENSE " ><img src =" https://img.shields.io/badge/license-MIT-informational " alt =" License " ></a >
1720 <a href =" https://slack.meilisearch.com " ><img src =" https://img.shields.io/badge/slack-MeiliSearch-blue.svg?logo=slack " alt =" Slack " ></a >
1821 <a href =" https://github.com/meilisearch/MeiliSearch/discussions " alt =" Discussions " ><img src =" https://img.shields.io/badge/github-discussions-red " /></a >
1922</p >
You can’t perform that action at this time.
0 commit comments