Skip to content

Publish

Publish #78

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
skipTests:
description: Skip tests
required: false
type: boolean
default: false
permissions:
id-token: write
contents: read
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_READ }}
jobs:
publish:
name: Publish packages to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Get Node.js version
id: nvm
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
- name: Configure AWS credentials
if: ${{ !inputs.skipTests }}
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ vars.DEV_NETWORK_AWS_ACCOUNT_ID }}:role/github
role-session-name: ${{ github.event.repository.name }}
aws-region: us-west-2
- name: Login to Amazon ECR
if: ${{ !inputs.skipTests }}
uses: aws-actions/amazon-ecr-login@v1
- name: Install packages
run: npm ci
- name: Build packages
run: npm run build
- name: Check types
run: npm run check-types:ci
- name: Run integration tests
if: ${{ !inputs.skipTests }}
run: npm run test:ci
- name: Prepare pacakges for publish
run: npm run package
- name: Publish packages
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN_PUBLISH}}
run: npm run release:publish -- --yes