Skip to content

Release Node.js Package #322

Release Node.js Package

Release Node.js Package #322

Workflow file for this run

name: Release Node.js Package
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'The version to release'
required: true
jobs:
release-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- run: npm install
- name: Update version in package.json, package-lock.json, and lib/version.ts
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION=${{ github.event.inputs.version }}
else
VERSION=${{ github.event.release.tag_name }}
fi
VERSION=${VERSION#v}
sed -i "s/__LINE_BOT_SDK_NODEJS_VERSION__/$VERSION/g" package.json
sed -i "s/__LINE_BOT_SDK_NODEJS_VERSION__/$VERSION/g" package-lock.json
sed -i "s/__LINE_BOT_SDK_NODEJS_VERSION__/$VERSION/g" lib/version.ts
- run: npm run release
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
deploy-docs:
needs: [release-package]
uses: ./.github/workflows/deploy-doc.yml