Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 authored Aug 26, 2024
1 parent 7b2a62e commit a3f19a6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Release Node.js Package
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'The version to release'
required: true

jobs:
release-package:
Expand All @@ -16,7 +21,11 @@ jobs:
- run: npm install
- name: Update version in package.json, package-lock.json, and lib/version.ts
run: |
VERSION=${{ github.event.release.tag_name }}
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
Expand Down

0 comments on commit a3f19a6

Please sign in to comment.