ci: auto release

This commit is contained in:
mirtlecn 2024-03-20 17:15:19 +08:00
parent 440ac15a13
commit 678979b989
2 changed files with 65 additions and 0 deletions

64
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,64 @@
name: Release CI
on:
push:
branches:
- main
tags:
- '[0-9]+.*'
paths:
- '**/**'
- '!**.md'
- '!**.gitignore'
- '!others/**'
- '!.github/**'
workflow_dispatch:
jobs:
Release:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Pack distributions
run: |
mkdir dist
Compress-Archive cn_dicts, en_dicts, lua, opencc, *.lua, *.yaml, *.txt dist/full.zip
Compress-Archive cn_dicts, en_dicts, opencc, radical_pinyin.dict.yaml dist/all_dicts.zip
Compress-Archive cn_dicts/* dist/cn_dicts.zip
Compress-Archive en_dicts/* dist/en_dicts.zip
Compress-Archive opencc/* dist/opencc.zip
Copy-Item LICENSE dist/
- name: Create nightly release
if: ${{ github.ref == 'refs/heads/main' }}
uses: 'softprops/action-gh-release@v2.0.2'
with:
body: |
## 文件说明
- `full.zip` : 包含所有词典和方案文件
- `cn_dicts.zip`:中文词库
- `en_dicts.zip`:英文词库
- `opencc.zip`opencc 词库emoji 等)
- `all_dicts.zip`:以上三个词库的整合
tag_name: nightly
name: "nightly build"
prerelease: true
generate_release_notes: true
fail_on_unmatched_files: true
files: |
dist/*
- name: Create stable release
if: startsWith(github.ref, 'refs/tags/')
uses: 'softprops/action-gh-release@v2.0.2'
with:
body_path: ${{ github.workspace }}/others/CHANGELOG.md
generate_release_notes: true
draft: true
prerelease: false
fail_on_unmatched_files: true
files: |
dist/*

1
.gitignore vendored
View File

@ -9,6 +9,7 @@ installation.yaml
user.yaml
*.custom.yaml
!others/**/*.custom.yaml
dist/
custom_phrase_double.txt
others/script/scel2txt/out/*