Skip to content

Commit

Permalink
ZhipuAI ChatGLM Bob Translator Plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
WhyMeta committed Apr 22, 2024
0 parents commit 57481e8
Show file tree
Hide file tree
Showing 13 changed files with 1,532 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/release.yaml
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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.bobplugin
release/
173 changes: 173 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions appcast.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"identifier": "whymeta.chatglm.translator",
"versions": []
}
Loading

0 comments on commit 57481e8

Please sign in to comment.