-
Notifications
You must be signed in to change notification settings - Fork 1k
163 lines (133 loc) · 6.34 KB
/
pr-packer.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# This is a basic workflow to help you get started with Actions
name: PR Packer
# Controls when the workflow will run
on:
workflow_dispatch:
pull_request:
branches: [ main ]
paths:
- 'config/packer.json'
- 'config/fontmap.txt'
- 'projects/**'
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 20
- name: Check changed path on 1.12
uses: MarceloPrado/[email protected]
id: changed-1122
with:
paths: projects/1.12.2
- name: Check changed path on 1.16
uses: MarceloPrado/[email protected]
id: changed-116
with:
paths: projects/1.16
- name: Check changed path on 1.16 fabric
uses: MarceloPrado/[email protected]
id: changed-116-fabric
with:
paths: projects/1.16-fabric
- name: Check changed path on 1.18
uses: MarceloPrado/[email protected]
id: changed-118
with:
paths: projects/1.18
- name: Check changed path on 1.18 fabric
uses: MarceloPrado/[email protected]
id: changed-118-fabric
with:
paths: projects/1.18-fabric
- name: Check changed path on 1.19
uses: MarceloPrado/[email protected]
id: changed-119
with:
paths: projects/1.19
# - name: Check changed path on 1.19 fabric
# uses: MarceloPrado/[email protected]
# id: changed-119-fabric
# with:
# paths: projects/1.19-fabric
- name: Build Packer
run: dotnet publish .\src\Packer\Packer.csproj -o ./ -r win-x64 -p:PublishSingleFile=true
- name: Run Packer for 1.12.2
run: ./Packer --version="1.12.2"
if: steps.changed-1122.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.16
run: ./Packer --version="1.16"
if: steps.changed-116.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.16-fabric
run: ./Packer --version="1.16-fabric"
if: steps.changed-116-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.18
run: ./Packer --version="1.18"
if: steps.changed-118.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.18-fabric
run: ./Packer --version="1.18-fabric"
if: steps.changed-118-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Run Packer for 1.19
run: ./Packer --version="1.19"
if: steps.changed-119.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
# - name: Run Packer for 1.19-fabric
# run: ./Packer --version="1.19-fabric"
# if: steps.changed-119-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Create timestamp
id: create_timestamp
run: echo "::set-output name=timestamp::$(date '+%Y%m%d%H%M%s')"
shell: bash
# 额 要两分半才能传完 然而 GitHub actions 直接传的话 会压成 zip 内套 zip 就这样了吧 --cy
- name: Unzip Files
run: |
unzip -q Minecraft-Mod-Language-Package-1.19.zip -d Minecraft-Mod-Language-Package-1.19 || echo 0
unzip -q Minecraft-Mod-Language-Package-1.16.zip -d Minecraft-Mod-Language-Package-1.16 || echo 0
unzip -q Minecraft-Mod-Language-Package-1.18.zip -d Minecraft-Mod-Language-Package-1.18 || echo 0
unzip -q Minecraft-Mod-Language-Package-1.16-fabric.zip -d Minecraft-Mod-Language-Package-1.16-fabric || echo 0
unzip -q Minecraft-Mod-Language-Package-1.18-fabric.zip -d Minecraft-Mod-Language-Package-1.18-fabric || echo 0
unzip -q Minecraft-Mod-Language-Package-1.12.2.zip -d Minecraft-Mod-Language-Package-1.12.2 || echo 0
# unzip -q Minecraft-Mod-Language-Package-1.19-fabric.zip -d Minecraft-Mod-Language-Package-1.19-fabric || echo 0
shell: bash
- name: Upload Artifact 1.12.2
uses: actions/[email protected]
with:
name: Minecraft-Mod-Language-Package-1.12.2
path: Minecraft-Mod-Language-Package-1.12.2/*
if: steps.changed-1122.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Upload Artifact 1.16
uses: actions/[email protected]
with:
name: Minecraft-Mod-Language-Package-1.16
path: Minecraft-Mod-Language-Package-1.16/*
if: steps.changed-116.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Upload Artifact 1.16 fabric
uses: actions/[email protected]
with:
name: Minecraft-Mod-Language-Package-1.16-fabric
path: Minecraft-Mod-Language-Package-1.16-fabric/*
if: steps.changed-116-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Upload Artifact 1.18
uses: actions/[email protected]
with:
name: Minecraft-Mod-Language-Package-1.18
path: Minecraft-Mod-Language-Package-1.18/*
if: steps.changed-118.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Upload Artifact 1.18 fabric
uses: actions/[email protected]
with:
name: Minecraft-Mod-Language-Package-1.18-fabric
path: Minecraft-Mod-Language-Package-1.18-fabric/*
if: steps.changed-118-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
- name: Upload Artifact 1.19
uses: actions/[email protected]
with:
name: Minecraft-Mod-Language-Package-1.19
path: Minecraft-Mod-Language-Package-1.19/*
if: steps.changed-119.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'
# - name: Upload Artifact 1.19 fabric
# uses: actions/[email protected]
# with:
# name: Minecraft-Mod-Language-Package-1.19-fabric
# path: Minecraft-Mod-Language-Package-1.19-fabric/*
# if: steps.changed-119-fabric.outputs.changed == 'true' || github.event_name == 'workflow_dispatch'