Merge pull request #207 from aws/jurredr/bump-version #148
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: Publish package to NPM | |
on: | |
push: | |
tags: ['v*.*'] | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '20.x' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@aws' | |
- run: npm ci | |
- name: Build mynah-ui | |
run: npm run build | |
- name: Run tests | |
run: npm run tests:unit && npm run tests:e2e | |
- name: Check lint | |
run: npm run lint | |
- name: Build demo app | |
run: npm run packdemo | |
- name: Get release info | |
id: get_release | |
uses: bruceadams/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Upload demo app to assets | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release.outputs.upload_url }} | |
asset_path: ./example/mynah-ui-demo.zip | |
asset_name: mynah-ui-demo.zip | |
asset_content_type: application/zip | |
- name: Publish to npm | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Update Channels | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: '${{ secrets.SLACK_ENDPOINT }}' | |
method: 'POST' | |
customHeaders: '{"Content-Type": "application/json"}' | |
data: '{"version": "${{ steps.get_release.outputs.tag_name }}", "url": "${{ steps.get_release.outputs.html_url }}"}' |