Update changes.log #222
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |