-
-
Notifications
You must be signed in to change notification settings - Fork 15
197 lines (167 loc) · 6.67 KB
/
Repack-and-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
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
name: Release HDL Batch Installer
on:
workflow_dispatch:
push:
paths:
- 'Release**'
- 'Release32**'
- 'translations/**'
- '.github/workflows/Repack-and-release.yml'
repository_dispatch:
types: [HDL_Dump_Updated_]
jobs:
Repack_and_Release:
runs-on: ubuntu-latest
steps:
- name: checkout code for release
uses: actions/checkout@v1
- name: "Check file existence"
uses: andstor/file-existence-action@v1
with:
files: "Release/HDL-Batch-installer.exe, Release32/HDL-Batch-installer.exe, Release/HDL.EXE, Release/boot.kelf, Release/Common/config.INI"
allow_failure: "true"
- name: Install dependencies
run: |
sudo apt-get install gettext p7zip dos2unix
- name: get version from changelog
shell: bash
run: echo "VERSION=$(grep -m1 '\[*\]' Release/changes.log | sed 's/\[//' | sed 's/\]//' | awk '{$1=$1;print}')" >> $GITHUB_ENV
id: version
- name: get version from changelog as release tag
shell: bash
run: echo "VERSION_TAG=$(grep -m1 '\[*\]' Release/changes.log | sed 's/\[//' | sed 's/\]//' | sed -r 's/\s+//g' | sed 's/Aniversary/aniv/' | sed 's/Revision/rev/' | sed 's/Release/rel/'| awk '{$1=$1;print}')" >> $GITHUB_ENV
id: tag
- name: Download Latest HDL-Dump
run: |
cd Release
wget https://github.com/israpps/hdl-dump/releases/download/hdlinst/HDL.EXE -O $PWD/HDL.EXE
- name: Trim changes of latest version
run: |
cd Release
sed -n '/Change log/,/^$/{/^$/q; p}' changes.log >> ../latest_changes.log
cd ..
sed -i 's/^[[:blank:]]*//g' latest_changes.log
sed -i 's/-/- /' latest_changes.log
sed -i 's/Change log:/## Latest changes:\n/' latest_changes.log
echo "****">>latest_changes.log
echo "See Full changelog [__Here__](https://github.com/israpps/HDL-Batch-installer/blob/Latest/Release/changes.log)">>latest_changes.log
echo "----------------CHANGELOG----------------"
cat latest_changes.log
echo "----------------CHANGELOG----------------"
- name: Compile translation catalogs
run: |
cd translations
cd catalogs
chmod +x ./build_catalogs.sh
./build_catalogs.sh
- name: Create translation template package
run: |
DATEE=`date '+[%Y-%m-%d]'`
mv translations HDLBinst-Translation-$DATEE
7z a -t7z -r Translation-template.7z HDLBinst-Translation-*/*.pot
- name: convert \n to \r\n
run: |
cd Release
unix2dos changes.log
unix2dos README.TXT
unix2dos HDL-Batch-installer.BAT
cd Common
unix2dos config.INI
- name: delete previous tag/release
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: Latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Repack latest x64 build
run: |
SCH=${GITHUB_SHA::7}
REF=${{ env.VERSION_TAG }}
cd Release
cd Common
echo commit $SCH>commit.sys
echo `date`>>commit.sys
echo pkgid $REF >>commit.sys
cd ..
cd ..
cp COPYING.* Release/
cp LICENSE Release/LICENSE
cp -r Release "HDLBInst[${{ env.VERSION }}-x64]"
7z a -t7z -r HDLBInst-x64-$REF.7z HDLBInst*x64*/*
- name: Repack latest x86 build
run: |
SCH=${GITHUB_SHA::7}
REF=${{ env.VERSION_TAG }}
cd Release
cd Common
echo 32bits build >>commit.sys
cd ..
cd ..
rm Release/HDL-Batch-installer.exe
rm Release/libps2hdd.dll
cp -r Release32/* Release/
mv Release "HDLBInst[${{ env.VERSION }}-x86]"
7z a -t7z -r HDLBInst-x86-$REF.7z HDLBInst*x86*/*
- name: Upload artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: HDL-INST
path: |
HDLBInst*.7z
Translation-template.7z
- name: Deploy pre-release
uses: softprops/action-gh-release@v1
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
with:
token: "${{ secrets.GITHUB_TOKEN }}"
fail_on_unmatched_files: true
files: |
HDLBInst*x64*.7z
HDLBInst*x86*.7z
Translation-template.7z
name: "${{ env.VERSION }}"
tag_name: "Latest"
body_path: 'latest_changes.log'
prerelease: false
discord_webhooks:
needs: Repack_and_Release
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: checkout code for release
uses: actions/checkout@v1
- name: get version from changelog
shell: bash
run: echo "::set-output name=string::$(grep -m1 '\[*\]' Release/changes.log | sed 's/\[//' | sed 's/\]//' | awk '{$1=$1;print}')"
id: version
- name: get version from changelog as release tag
shell: bash
run: echo "::set-output name=version_tag::$(grep -m1 '\[*\]' Release/changes.log | sed 's/\[//' | sed 's/\]//' | sed -r 's/\s+//g' | sed 's/Revision/rev/' | sed 's/Release/rel/' | awk '{$1=$1;print}')"
id: tag
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: HDL-INST
- name: Discord Webhook, Latest release
if: github.event_name == 'push'
uses: tsickert/[email protected]
with:
username: GitHub
webhook-url: ${{ secrets.TESTERS_WEBHOOK }}
content: "<@&859572447761793034> & <@&859615291477590046> , HDL Batch Installer has been updated some minutes ago\\n according to changelog: **[${{ env.VERSION }}]** \\n as always, you can download the latest version from here:\\n https://github.com/israpps/HDL-Batch-installer/releases/tag/Latest \\n or <#863913236457062421>"
- name: Discord Webhook, Latest release
if: github.event_name == 'repository_dispatch'
uses: tsickert/[email protected]
with:
username: GitHub
webhook-url: ${{ secrets.TESTERS_WEBHOOK }}
content: "<@&859572447761793034> & <@&859615291477590046> , HDL Batch Installer **[${{ env.VERSION }}]** Has been **re-released** because **HDL Dump was updated** some minutes ago \\n as always, you can download the latest version from here:\\n https://github.com/israpps/HDL-Batch-installer/releases/tag/Latest \\n or <#863913236457062421>"
- name: Upload release to discord backup
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.BACKUP_WEBHOOK }}
with:
args: HDL-INST/HDLBInst*.7z