-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 2.16 KB
/
Copy pathauto_release_version.yaml
File metadata and controls
60 lines (55 loc) · 2.16 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
name: Auto Release Version
on:
push:
tags: ["v*"]
jobs:
build-and-release:
runs-on: ubuntu-22.04
permissions:
contents: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libwebkit2gtk-4.1-dev libgtk-layer-shell-dev pkg-config
version: 1.0
- uses: actions/setup-node@v4
- name: Install dependencies
run: npm ci
- name: Build frontend
run: npm run build
- name: Download mikami
run: |
wget -q https://github.com/HumXC/mikami/releases/download/latest/mikami
chmod +x mikami
- name: Bundle frontend
run: ./mikami bundle ./dist mika-shell HumXC/mika-shell
- name: Get Version Info
id: version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
# 提取 tag 并校验格式
TAG_NAME=${GITHUB_REF#refs/tags/}
if [[ $TAG_NAME =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-z]+\.?[0-9]*)?$ ]]; then
echo "RELEASE_TAG=$TAG_NAME" >> $GITHUB_ENV
echo "RELEASE_NAME=$TAG_NAME" >> $GITHUB_ENV
else
echo "::error::Tag format invalid, must be vX.Y.Z or vX.Y.Z-rc.n"
exit 1
fi
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE_TAG }}
name: ${{ env.RELEASE_NAME }}
body: |
${{ github.event.head_commit.message }}
Commit SHA: ${{ github.sha }}
draft: false
prerelease: ${{ contains(env.RELEASE_TAG, '-') }} # 包含连字符标记为预发布
files: |
mika-shell