-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZhipuAI ChatGLM Bob Translator Plugin
- Loading branch information
0 parents
commit 57481e8
Showing
13 changed files
with
1,532 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
# branches: [ main ] | ||
tags: [ v\d+\.\d+\.\d+ ] | ||
|
||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PAT }} | ||
|
||
- name: Get version | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
|
||
- name: Get tag message | ||
id: tag | ||
run: | | ||
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
echo "message=$(git tag -l --format='%(contents:subject)' ${{ steps.get_version.outputs.version }})" >> $GITHUB_OUTPUT | ||
- name: Change version | ||
run: | | ||
OLD_VERSION=$(grep '"version":' src/info.json | awk -F\" '{print $4}') | ||
sed -i "s/$OLD_VERSION/${{ steps.get_version.outputs.version-without-v }}/" src/info.json | ||
- name: Package plugin | ||
run: mkdir release && zip -j -r release/chatglm-translator-${{ steps.get_version.outputs.version-without-v }}.bobplugin ./src/* | ||
- run: git checkout -- src/ | ||
|
||
- name: Update appcast.json | ||
env: | ||
VERSION: ${{ steps.get_version.outputs.version-without-v }} | ||
MESSAGE: ${{ steps.tag.outputs.message }} | ||
run: | | ||
python3 scripts/update_release.py "$VERSION" "$MESSAGE" | ||
- name: Commit files | ||
run: | | ||
git config --global user.name 'WhyMeta' | ||
git config --global user.email '[email protected]' | ||
git commit -am '😡Annoyed: update appcast.json and info.json' | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.PAT }} | ||
|
||
- name: Upload binaries to release | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
release_name: ${{ steps.get_version.outputs.version }} | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: release/chatglm-translator-${{ steps.get_version.outputs.version-without-v }}.bobplugin | ||
asset_name: chatglm-translator-${{ steps.get_version.outputs.version-without-v }}.bobplugin | ||
tag: ${{ github.ref }} | ||
overwrite: true | ||
body: ${{ steps.tag.outputs.message }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.bobplugin | ||
release/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"identifier": "whymeta.chatglm.translator", | ||
"versions": [] | ||
} |
Oops, something went wrong.