Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Xikaro committed Aug 17, 2023
1 parent 6b71532 commit 0f76eae
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 9 deletions.
138 changes: 138 additions & 0 deletions .github/workflows/release-no-curse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Deploy modpack

on:
push:
tags:
- "R*.*.*"

jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master

- name: Get the version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/R}

- name: Changelog Parser RU
id: changelog_ru
uses: coditory/changelog-parser@v1
with:
path: CHANGELOG_RU.md

- name: Changelog Parser EN
id: changelog_en
uses: coditory/changelog-parser@v1
with:
path: CHANGELOG_EN.md

- name: normal -> extended
run: |
rsync -av --exclude-from='buildtools/filelist.txt' ./ ./.minecraft/
cp -r ./.minecraft/* ./extended/.minecraft/
cp -r ./modlist.html ./extended/modlist_temp.html
cp -r ./manifest.json ./extended/manifest_temp.json
sed -i -e 1,16d ./extended/manifest_temp.json
sed 1d ./extended/modlist_temp.html
cat ./extended/modlist_extended.html ./extended/modlist_temp.html > ./extended/modlist.html
cat ./extended/manifest_extended.json ./extended/manifest_temp.json > ./extended/manifest.json
- name: Set the version
run: |
DEV=${{ steps.get_version.outputs.version }}
sed -i -e "s/DEV/${DEV}/g" ./extended/.minecraft/config/fancymenu/customization/tfg_version.txt
sed -i -e "s/DEV/${DEV}/g" ./manifest.json
sed -i -e "s/DEV/${DEV}/g" ./instance.cfg
sed -i -e "s/DEV/${DEV}/g" ./.minecraft/config/fancymenu/customization/tfg_version.txt
sed -i -e "s/DEV/${DEV}/g" ./extended/manifest.json
sed -i -e "s/DEV/${DEV}/g" ./extended/instance.cfg
- name: Archive Release MMC normal
run: zip -r ./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-mmc.zip ./mmc-pack.json ./instance.cfg .minecraft/

- name: Archive Release MMC extended
run: |
cd ./extended/
zip -r ../TFG-NewHorizons-${{ steps.get_version.outputs.version }}-mmc-extended.zip ./mmc-pack.json ./instance.cfg ./.minecraft/
- name: Archive Release CF normal
run: |
mv -vf .minecraft/ ./overrides/
zip -r ./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-cf.zip ./manifest.json ./modlist.html ./overrides/bansoukou/ ./overrides/config/ ./overrides/resourcepacks/ ./overrides/shaderpacks/ ./overrides/groovy/ ./overrides/resources/ ./overrides/scripts/
- name: Archive Release CF extended
run: |
cd ./extended/
mv -vf .minecraft/ ./overrides/
zip -r ../TFG-NewHorizons-${{ steps.get_version.outputs.version }}-cf-extended.zip ./manifest.json ./modlist.html ./overrides/bansoukou/ ./overrides/config/ ./overrides/resourcepacks/ ./overrides/shaderpacks/ ./overrides/groovy/ ./overrides/resources/ ./overrides/scripts/
- name: Deleting Client Resources normal
run: |
cd ./overrides/
cat ../buildtools/client_mod.txt | while read -r line; do find ./mods -name "$line" -delete; done
rm -rf ./resourcepacks ./resources ./shaderpacks
- name: Deleting Client Resources extended
run: |
cd ./extended/overrides/
cat ../../buildtools/client_mod.txt | while read -r line; do find ./mods -name "$line" -delete; done
rm -rf ./resourcepacks ./resources ./shaderpacks
- name: Archive Release Server normal
run: |
cp -r ./buildtools/serverfiles/* ./overrides/
cd ./overrides/
mv -vf ./icon.png ./server-icon.png
zip -r ../TFG-NewHorizons-${{ steps.get_version.outputs.version }}-server.zip ./
- name: Archive Release Server extended
run: |
cp -r ./buildtools/serverfiles/* ./extended/overrides/
cd ./extended/overrides/
zip -r ../../TFG-NewHorizons-${{ steps.get_version.outputs.version }}-server-extended.zip ./
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: false
generate_release_notes: true
name: Release ${{ steps.changelog_ru.outputs.version }}
body: ${{ steps.changelog_ru.outputs.description }}
files: |
./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-cf.zip
./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-cf-extended.zip
./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-mmc.zip
./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-mmc-extended.zip
./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-server.zip
./TFG-NewHorizons-${{ steps.get_version.outputs.version }}-server-extended.zip
- name: Discord notification RU
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_RU }}
username: "GitHub"
avatar-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/github.png?raw=true
embed-thumbnail-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-title: Релиз ${{ steps.changelog_ru.outputs.version }}
embed-description: "${{ steps.changelog_ru.outputs.description }}"
embed-url: https://github.com/TerraFirmaGreg-New-Horizons/TFG-Modpack-1.12.x/tree/main/CHANGELOG_RU.md
embed-color: 15430476
embed-footer-icon-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-footer-text: ${{ steps.changelog_ru.outputs.date }}

- name: Discord notification EN
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_EN }}
username: "GitHub"
avatar-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/github.png?raw=true
embed-thumbnail-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-title: Release ${{ steps.changelog_en.outputs.version }}
embed-description: "${{ steps.changelog_en.outputs.description }}"
embed-url: https://github.com/TerraFirmaGreg-New-Horizons/TFG-Modpack-1.12.x/tree/main/CHANGELOG_EN.md
embed-color: 15430476
embed-footer-icon-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-footer-text: ${{ steps.changelog_en.outputs.date }}
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy modpack
on:
push:
tags:
- "R*.*.*"
- "R*.*.*|"

jobs:
Deploy:
Expand Down Expand Up @@ -142,25 +142,25 @@ jobs:
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_RU }}
username: "GitHub"
avatar-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/blob/main/resources/modpack/icons/github.png?raw=true
embed-thumbnail-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/blob/main/resources/modpack/icons/icon.png?raw=true
avatar-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/github.png?raw=true
embed-thumbnail-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-title: Релиз ${{ steps.changelog_ru.outputs.version }}
embed-description: "${{ steps.changelog_ru.outputs.description }}"
embed-url: https://github.com/TerraFirmaGreg-New-Horizons/TFG-Modpack-1.12.x/blob/main/CHANGELOG_RU.md
embed-url: https://github.com/TerraFirmaGreg-New-Horizons/TFG-Modpack-1.12.x/tree/main/CHANGELOG_RU.md
embed-color: 15430476
embed-footer-icon-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/blob/main/resources/modpack/icons/icon.png?raw=true
embed-footer-icon-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-footer-text: ${{ steps.changelog_ru.outputs.date }}

- name: Discord notification EN
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.DISCORD_WEBHOOK_EN }}
username: "GitHub"
avatar-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/blob/main/resources/modpack/icons/github.png?raw=true
embed-thumbnail-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/blob/main/resources/modpack/icons/icon.png?raw=true
avatar-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/github.png?raw=true
embed-thumbnail-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-title: Release ${{ steps.changelog_en.outputs.version }}
embed-description: "${{ steps.changelog_en.outputs.description }}"
embed-url: https://github.com/TerraFirmaGreg-New-Horizons/TFG-Modpack-1.12.x/blob/main/CHANGELOG_EN.md
embed-url: https://github.com/TerraFirmaGreg-New-Horizons/TFG-Modpack-1.12.x/tree/main/CHANGELOG_EN.md
embed-color: 15430476
embed-footer-icon-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/blob/main/resources/modpack/icons/icon.png?raw=true
embed-footer-icon-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.12.x/tree/main/resources/modpack/icons/icon.png?raw=true
embed-footer-text: ${{ steps.changelog_en.outputs.date }}

0 comments on commit 0f76eae

Please sign in to comment.