Skip to content

CI: Add package publication to workflow #32

CI: Add package publication to workflow

CI: Add package publication to workflow #32

Workflow file for this run

name: "CI"
on: pull_request
jobs:
tests:
uses: ./.github/workflows/tests.yml
type-check:
uses: ./.github/workflows/type-check.yml
build:
needs: [tests, type-check]
uses: ./.github/workflows/build.yml
with:
artifact-name: "lib-${{ github.head_ref }}"
build-storybook:
needs: [tests, type-check]
uses: ./.github/workflows/build-storybook.yml
with:
artifact-name: "storybook-${{ github.head_ref }}"
publish-package:
needs: build
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
# TODO: add version to a .nvmrc or at least a variable
node-version: 18.12.1
cache: npm
registry-url: 'https://npm.pkg.github.com'
- name: Install
run: npm ci --omit=dev --prefer-offline
- name: Download dist
uses: actions/download-artifact@v4
with:
name: "lib-${{ github.head_ref }}"
path: "./dist"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}