Skip to content

Commit

Permalink
ci: 自动修改主题包版本字段
Browse files Browse the repository at this point in the history
  • Loading branch information
wan92hen committed Sep 20, 2024
1 parent b778f7a commit 687b682
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ jobs:
uses: rlespinasse/github-slug-action@v4
- name: Compress zip
run: |
PACKAGE_VERSION=$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json)
PACKAGE_VERSION=${{ github.event.release.tag_name }}
sed -iE "s/(^\s*\"version\": )\".*?\",$/\1\"${PACKAGE_VERSION}\"/g" package.json
sed -iE "s/(^\s*version: ).*?$/\1${PACKAGE_VERSION}/g" theme.yaml
PACKAGE_NAME=${GITHUB_REPOSITORY_NAME_PART_SLUG}
PRE_ZIP_FOLDER=${PACKAGE_NAME}-${PACKAGE_VERSION}
ARTIFACT_NAME=${PRE_ZIP_FOLDER}.zip
Expand Down

0 comments on commit 687b682

Please sign in to comment.