forked from MizuhaHimuraki/github-name-mapper
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (75 loc) · 2.82 KB
/
Copy pathrelease.yml
File metadata and controls
90 lines (75 loc) · 2.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
version:
description: '版本号 (如: 1.0.1)'
required: true
type: string
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ inputs.version }}" >> $GITHUB_OUTPUT
echo "tag=v${{ inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Update manifest version
run: |
VERSION=${{ steps.version.outputs.version }}
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" manifest.json
cat manifest.json
- name: Create ZIP package
run: |
zip -r github-name-mapper-${{ steps.version.outputs.tag }}.zip . \
-x "*.git*" \
-x "*.github*" \
-x "*.DS_Store" \
-x "*.md" \
-x "sample-data.json"
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.tag }}
name: Release ${{ steps.version.outputs.tag }}
body: |
## 📦 GitHub Name Mapper ${{ steps.version.outputs.tag }}
### Installation / 安装方式
**English:**
1. Download `github-name-mapper-${{ steps.version.outputs.tag }}.zip`
2. Extract to a local folder
3. Open Chrome → `chrome://extensions/`
4. Enable "Developer mode"
5. Click "Load unpacked" and select the extracted folder
**中文:**
1. 下载 `github-name-mapper-${{ steps.version.outputs.tag }}.zip`
2. 解压到本地文件夹
3. 打开 Chrome → `chrome://extensions/`
4. 开启「开发者模式」
5. 点击「加载已解压的扩展程序」选择解压后的文件夹
### Update / 更新方式
**English:**
1. Download the new version ZIP and extract
2. Go to `chrome://extensions/`, find the extension, click refresh
**中文:**
1. 下载新版本 ZIP 并解压
2. 在 `chrome://extensions/` 找到扩展,点击刷新按钮
files: |
github-name-mapper-${{ steps.version.outputs.tag }}.zip
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}