Skip to content

v1.0.0-beta.1

v1.0.0-beta.1 #12

Workflow file for this run

name: Publish to NPM
on:
release:
types:
- published
jobs:
deploy:
runs-on: ${{ matrix.os }}
env:
TERM: xterm
PRERELEASE_TAG: edge
strategy:
matrix:
os:
- ubuntu-22.04
node-version:
- '16'
steps:
# Install deps and cache
- name: Checkout code
uses: actions/checkout@v3
- name: Install node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org
cache: yarn
- name: Install Yarn dependencies
run: yarn install --prefer-offline --frozen-lockfile
# Let's do tests rq just to make sure we dont push something that is fundamentally broken
- name: Lint code
run: yarn lint
- name: Run unit tests
run: yarn test:unit
- name: Run leia tests
run: yarn leia examples/basic-example.md
- name: Prepare release
uses: lando/prepare-release-action@v2
- name: Publish to npm
run: |
if [ "${{ github.event.release.prerelease }}" == "false" ]; then
npm publish --access public --dry-run
npm publish --access public
echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}::This is a stable release published to the default 'latest' npm tag"
else
npm publish --access public --tag ${{ env.PRERELEASE_TAG }} --dry-run
npm publish --access public --tag ${{ env.PRERELEASE_TAG }}
echo "::notice title=Published ${{ github.ref_name }} to @${{ github.repository }}@${{ env.PRERELEASE_TAG }}::This is a pre-release published to the '${{ env.PRERELEASE_TAG }}' npm tag"
fi
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}}