Skip to content

Manual Publish Package #52

Manual Publish Package

Manual Publish Package #52

name: Manual Publish Package
on:
workflow_dispatch:
inputs:
dry-run:
description: 'Is this a dry run. If so no package will be published.'
type: boolean
required: true
prerelease:
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
type: boolean
required: true
release_highlight:
description: 'Should release @highlight-run/... packages.'
type: boolean
required: true
release_launchdarkly:
description: 'Should release @launchdarkly/... packages.'
type: boolean
required: true
permissions:
id-token: write
contents: write
packages: write
pull-requests: write
issues: read
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish-package:
runs-on: ubuntu-22.04-8core-32gb
steps:
- name: Checkout
uses: actions/checkout@v4
- run: git submodule update --init --recursive
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'yarn'
- name: Install js dependencies
run: yarn install
- name: Build & test
run: yarn test
env:
NEXT_PUBLIC_HIGHLIGHT_PROJECT_ID: 1jdkoe52
REACT_APP_COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Configure yarn npm registry credentials for highlight
if: ${{ inputs.release_highlight == true }}
run: |
yarn config set npmRegistryServer "https://registry.npmjs.org"
yarn config set npmAuthToken "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_HIGHLIGHT_RUN }}
- name: Publish highlight npm packages
if: ${{ inputs.release_highlight == true }}
id: changesets-publish
run: yarn publish:highlight
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
if: ${{ inputs.release_launchdarkly == true }}
name: 'Get NPM token'
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'
- name: Configure yarn npm registry credentials for launchdarkly
if: ${{ inputs.release_launchdarkly == true }}
run: |
yarn config set npmRegistryServer "https://registry.npmjs.org"
yarn config set npmAuthToken "${NODE_AUTH_TOKEN}"
- name: Publish
if: ${{ inputs.release_launchdarkly == true }}
shell: bash
run: ./scripts/publish-npm.sh
env:
LD_RELEASE_IS_PRERELEASE: ${{ inputs.prerelease }}
LD_RELEASE_IS_DRYRUN: ${{ inputs.dry-run }}