Release X-Ray Node SDK to Github and NPM #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: Release X-Ray Node SDK to Github and NPM | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: The version to tag the release with, e.g., 1.2.0, 1.2.1-alpha.1 | |
required: true | |
jobs: | |
publish_xray_node_sdk: | |
name: Test and publish X-Ray Node SDK to NPM registry and Github | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm install -g npm@8.19.4 | |
- name: Cache NPM modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
package-lock.json | |
packages/*/node_modules | |
packages/*/package-lock.json | |
key: release-ubuntu-latest-${{ hashFiles('package.json', 'packages/*/package.json') }}-06142023 | |
- name: Bootstrap | |
run: | | |
npm ci | |
npx lerna bootstrap --no-ci --hoist | |
- name: Build | |
run: | | |
npx lerna run compile | |
shell: bash | |
- name: Execute tests with Lerna | |
run: | | |
npx lerna run test | |
shell: bash | |
- name: Publish package to npm | |
run: npx lerna publish from-package --yes --exact --no-verify-access | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: 'aws-xray-sdk-node@${{ github.event.inputs.version }}' | |
release_name: 'Release ${{ github.event.inputs.version }}' | |
body: 'Please see [CHANGELOG](https://github.com/aws/aws-xray-sdk-node/blob/master/CHANGELOG.md) for details.' | |
draft: true | |
prerelease: false |