From 6762a45a896572437160d530650735f2c2ee50f5 Mon Sep 17 00:00:00 2001 From: xiaoweii Date: Tue, 22 Aug 2023 10:10:36 +0800 Subject: [PATCH] ci: add release new version action --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ release.sh | 7 +++++++ tsconfig.json | 6 +----- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100755 release.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7ac889d --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..88afd50 --- /dev/null +++ b/release.sh @@ -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 diff --git a/tsconfig.json b/tsconfig.json index 42429de..cf26dfa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,11 +15,7 @@ "incremental": true, "importHelpers": true, "outDir": "lib", - "resolveJsonModule": true, - "types": [ - "node", - "jest" - ] + "resolveJsonModule": true }, "include": [ "src"