Skip to content

Commit

Permalink
ci: add release new version action
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweii committed Aug 22, 2023
1 parent 6b3b527 commit 6762a45
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Next Version
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release Tag'
required: true
type: string
env:
NEW_VERSION: ${{ github.event.inputs.release_tag }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
fetch-depth: 0
token : ${{ secrets.PROJECT_TOKEN }}
- name: Modify for next release
run: |
chmod +x release.sh
./release.sh ${{ env.NEW_VERSION }}
git diff
git config user.name '${{ vars.USER_NAME }}'
git config user.email '${{ vars.USER_EMAIL }}'
git add .
git commit -m 'release: clickstream Web ${{ env.NEW_VERSION }}'
git push
7 changes: 7 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

version="$1"
echo ${version}
regex="[0-9]\+\.[0-9]\+\.[0-9]\+"

sed -i "s/\"version\": \"${regex}\"/\"version\": \"${version}\"/g" package.json
6 changes: 1 addition & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@
"incremental": true,
"importHelpers": true,
"outDir": "lib",
"resolveJsonModule": true,
"types": [
"node",
"jest"
]
"resolveJsonModule": true
},
"include": [
"src"
Expand Down

0 comments on commit 6762a45

Please sign in to comment.