Merge pull request #17 from multiversx/development #21
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 sdk-dapp-core | |
on: | |
push: | |
branches: [main] | |
repository_dispatch: | |
types: publish-npm | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- name: Setup yarn | |
run: npm install -g yarn | |
- name: Install dependencies | |
run: yarn install | |
- name: Run tests | |
run: yarn test | |
- name: Build project | |
run: yarn compile | |
- name: Get package info | |
id: package | |
uses: andreigiura/[email protected] | |
- name: Publish to npmjs next version | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
if: ${{ steps.package.outputs.is-prerelease == 'true'}} | |
run: echo ${{ steps.package.outputs.is-prerelease}} && npm publish --tag next | |
- name: Publish to npmjs | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
if: ${{ steps.package.outputs.is-prerelease == 'false' }} | |
run: npm publish |