diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a19fa97 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10, 12, 14, 15] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + + - name: Install + run: npm install + + - name: Link check + run: npm run lint + + - name: Tests and benchmark + run: npm run test && npm run benchmark diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e874e2f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,18 @@ +name: Publish +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: "https://registry.npmjs.org" + - run: npm install + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/README.md b/README.md index 0545dfc..24570da 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,13 @@ # Banknote +[![NPM](https://nodei.co/npm/banknote.png)](https://npmjs.org/package/banknote) Banknote is a small, easy-to-use JavaScript library that provides a simple way to format monetary amounts in multiple locales and currencies. It’s mainly targeted at Node.js, but also works in the browser (if needed) with module bundlers like [Webpack](https://webpack.github.io/) and [Browserify](http://browserify.org/). + +![build](https://github.com/zalando-incubator/banknote/actions/workflows/build.yml/badge.svg) +[![downloads](https://img.shields.io/npm/dt/banknote.svg)](https://npmjs.org/package/banknote?cacheSeconds=3600) +[![version](https://img.shields.io/npm/v/banknote.svg)](https://npmjs.org/package/banknote?cacheSeconds=3600) + ## Features Banknote addresses a common problem faced by anyone (for example, an e-commerce company) who has to update and format prices on the frontend. It is different from similar projects in that it follows Unicode CLDR formatting standards, not an ad hoc data solution. It also: