feat: add Shadow DOM isolation for popup to prevent host page style p… #14
Workflow file for this run
This file contains hidden or 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
| name: Release Extension | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # 只在推送 v* 格式的 tag 时触发(如 v0.11.1, v1.0.0) | |
| permissions: | |
| contents: write # 需要写权限来创建 release | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # 获取完整历史记录和所有 tags | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 9 | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Get version from tag | |
| id: version | |
| run: | | |
| # 从 tag 中提取版本号(去掉 v 前缀) | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Generate Changelog | |
| id: changelog | |
| run: | | |
| # 获取当前 tag | |
| CURRENT_TAG="${GITHUB_REF#refs/tags/}" | |
| # 获取上一个 tag(按版本号排序,排除当前 tag) | |
| PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -v "^${CURRENT_TAG}$" | head -n 1) | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| echo "This is the first release" | |
| CHANGELOG="🎉 First Release / 首次发布" | |
| else | |
| echo "Generating changelog from $PREVIOUS_TAG to $CURRENT_TAG" | |
| # 生成详细的 changelog,包含完整提交信息 | |
| CHANGELOG=$(git log ${PREVIOUS_TAG}..${CURRENT_TAG} --pretty=format:"- **%s** ([%h](https://github.com/${{ github.repository }}/commit/%H))" --no-merges) | |
| if [ -z "$CHANGELOG" ]; then | |
| CHANGELOG="- No code changes (repackaged only) / 无代码更改(仅重新打包)" | |
| fi | |
| fi | |
| # 保存到 GITHUB_OUTPUT(处理多行) | |
| { | |
| echo 'changelog<<EOF' | |
| echo "$CHANGELOG" | |
| echo EOF | |
| } >> $GITHUB_OUTPUT | |
| - name: Build extension | |
| run: pnpm run build:zip | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: extension.zip | |
| body: | | |
| 🚀 **DeepSeek AI Extension ${{ steps.version.outputs.tag }}** | |
| --- | |
| ## 📦 Installation / 安装说明 | |
| **English:** | |
| 1. Download the `extension.zip` file below | |
| 2. Extract the zip file | |
| 3. Open your browser's extension management page | |
| 4. Enable "Developer mode" | |
| 5. Click "Load unpacked" and select the extracted folder | |
| **中文:** | |
| 1. 下载下方的 `extension.zip` 文件 | |
| 2. 解压缩文件 | |
| 3. 在浏览器中打开扩展管理页面 | |
| 4. 启用"开发者模式" | |
| 5. 点击"加载已解压的扩展程序"并选择解压后的文件夹 | |
| --- | |
| ## 📝 Changelog / 更新日志 | |
| ${{ steps.changelog.outputs.changelog }} | |
| --- | |
| 💡 View full commit history / 查看完整提交历史:[Click here / 点击这里](https://github.com/${{ github.repository }}/compare/${{ steps.version.outputs.tag }}...HEAD) | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |