-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.35 KB
/
release.yml
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
name: Release
on:
push:
branches:
- master # 或者是您用于发布的任何分支
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 获取版本号
run: |
VERSION=$(cat module.prop | grep 'version' | sed 's/version=//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: 打印版本号
run: echo "提取的版本号为 ${{ env.VERSION }}"
- name: 压缩文件
run: |
zip -r alist-ddns-go_${{ env.VERSION }}.zip ./* # 根据版本号命名压缩包
- name: 创建 Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }} # 使用提取的版本号作为标签名
release_name: alist-ddns-go_${{ env.VERSION }} # 使用提取的版本号作为 Release 名称
draft: false
prerelease: false
body: |
发布的详细信息
- name: 上传 Release 文件
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./alist-ddns-go_${{ env.VERSION }}.zip
asset_name: alist-ddns-go_${{ env.VERSION }}.zip
asset_content_type: application/zip