-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (41 loc) · 1.49 KB
/
update-version.yml
File metadata and controls
46 lines (41 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Update version
on:
workflow_dispatch:
inputs:
libraryVersion:
description: 'Library Version'
required: true
default: ''
packageVersion:
description: 'Package Version'
required: true
default: ''
jobs:
# Set version in package.json, git tag
update-version:
runs-on: ubuntu-latest
env:
LIBRARY_VERSION: ${{ github.event.inputs.libraryVersion }}
PACKAGE_VERSION: ${{ github.event.inputs.packageVersion }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Update Library Version
run: |
sed -i -E 's/^([[:space:]]*)VERSION="[^"]*"/\1VERSION="v${{ env.LIBRARY_VERSION }}"/' scripts/*.sh
sed -i -E 's/^([[:space:]]*\$lexfloatclient_version[[:space:]]*=[[:space:]]*)"[^"]*"/\1"v${{ env.LIBRARY_VERSION }}"/' scripts/*.ps1
- name: Update Package Version
run: |
jq --arg v "${{ env.PACKAGE_VERSION }}" '.version = $v' package.json > package.json.new && mv package.json.new package.json
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: ci/${{ env.PACKAGE_VERSION }}
title: "chore: bump package version to ${{ env.PACKAGE_VERSION }}"
commit-message: "chore(package version): updated version"
body: |
Automated package version bump.
base: master
add-paths: |
package.json
scripts/*.*