-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.87 KB
/
Modpack-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
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
name: 模組包 - 發布
on:
workflow_call:
inputs:
modpack-version:
required: true
type: string
modpack-official-version:
required: true
type: string
modpack-per-release:
required: true
type: string
modpack-release-ignore:
required: false
type: string
default: "false"
release-body-path:
required: false
type: string
default: ".github/configs/release_body.md"
jobs:
Release:
name: 發布版本
if: ${{ inputs.modpack-release-ignore != 'true' }}
runs-on: ubuntu-latest
steps:
- name: 查看專案
uses: actions/checkout@v4
- name: 變數替換
id: var
run: |
modpack_name=$(yq e .modpack-name .github/configs/config.yml)
echo "modpack_name=$modpack_name" >> "$GITHUB_OUTPUT"
sed -i "s/\$ModPack_Name_VAR/${modpack_name}/g" ${{ inputs.release-body-path }}
sed -i 's/$ModPack_Version_VAR/${{ inputs.modpack-official-version }}/g' ${{ inputs.release-body-path }}
- name: 下載補丁成品
uses: actions/download-artifact@v4
with:
name: Patches-Modpack
- name: 清理所有工作流程成品
uses: geekyeggo/delete-artifact@v5
with:
name: |
Patches-Resourcepack
Patches-Modpack
- name: 製作檔案校對和
run: |
ls -alh
sha256sum *.zip > checksums.txt
- name: 創建發布
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.var.outputs.modpack_name }} 中文化翻譯 ${{ inputs.modpack-version }}
tag_name: ${{ inputs.modpack-version }}
prerelease: ${{ inputs.modpack-per-release }}
files: |
*.zip
checksums.txt
body_path: ${{ inputs.release-body-path }}