-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 1.13 KB
/
build.yaml
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
# After pushing a tag (e.g., v1.0.0), GitHub Actions starts
# 1. It checks out the code at the commit where the tag was created
# 2. Creates the build package using the latest state (with updated metadata)
name: Build Hanzi2Pinyin Package
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create Package
run: |
mkdir -p build/Hanzi2Pinyin
cp -r addon/* build/Hanzi2Pinyin/
cd build
zip -r "../Hanzi2Pinyin_${GITHUB_REF#refs/tags/v}.zip" Hanzi2Pinyin/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
name: Hanzi2Pinyin v${{ steps.get_version.outputs.VERSION }}
files: Hanzi2Pinyin_${{ steps.get_version.outputs.VERSION }}.zip
body_path: CHANGELOG.md
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}