Merge pull request #325 from TykTechnologies/datepicker-tests #102
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: Build and Publish | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build-lib: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: [16.x] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.TYK_UI_TOKEN }} | |
- name: Use node ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: | | |
npm config set //registry.npmjs.org/:_authToken "${{ secrets.NPM_TOKEN }}" && npm ci | |
- name: Run production build | |
run: | | |
npm run build-prod | |
- name: Generate package-lock.json | |
run: | | |
npm i --package-lock-only | |
- name: get-npm-version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@master | |
- name: Push changes | |
run: | | |
git config --local user.email "tyk-ui-bot@tyk.io" | |
git config --local user.name "tyk-ui bot" | |
git add . | |
git commit -m "Update lib to version ${{ steps.package-version.outputs.current-version}}" | |
git push | |
- name: Publish lib to npm | |
uses: JS-DevTools/npm-publish@v1 | |
with: | |
token: ${{ secrets.NPM_PUBLISH_TOKEN }} | |
env: | |
CI: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |