Skip to content

Commit 45466a0

Browse files
zhu-xiaoweixiaoweii
andauthored
ci: add release new version action (#12)
Co-authored-by: xiaoweii <xiaoweii@amazom.com>
1 parent 90b9e9e commit 45466a0

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Release Next Version
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release_tag:
6+
description: 'Release Tag'
7+
required: true
8+
type: string
9+
env:
10+
NEW_VERSION: ${{ github.event.inputs.release_tag }}
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
with:
17+
ref: main
18+
fetch-depth: 0
19+
token : ${{ secrets.PROJECT_TOKEN }}
20+
- name: Modify for next release
21+
run: |
22+
chmod +x release.sh
23+
./release.sh ${{ env.NEW_VERSION }}
24+
git diff
25+
git config user.name '${{ vars.USER_NAME }}'
26+
git config user.email '${{ vars.USER_EMAIL }}'
27+
git add .
28+
git commit -m 'release: clickstream Web ${{ env.NEW_VERSION }}'
29+
git push

release.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
version="$1"
4+
echo ${version}
5+
regex="[0-9]\+\.[0-9]\+\.[0-9]\+"
6+
7+
sed -i "s/\"version\": \"${regex}\"/\"version\": \"${version}\"/g" package.json

tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
"incremental": true,
1616
"importHelpers": true,
1717
"outDir": "lib",
18-
"resolveJsonModule": true,
19-
"types": [
20-
"node",
21-
"jest"
22-
]
18+
"resolveJsonModule": true
2319
},
2420
"include": [
2521
"src"

0 commit comments

Comments
 (0)