Skip to content

Update preview.yml

Update preview.yml #47

Workflow file for this run

name: Deploy modpack
on:
push:
tags:
- "*.*.*"
jobs:
Deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Get the version
id: get_version
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/}
- name: Changelog Parser
id: changelog
uses: coditory/changelog-parser@v1.0.2
with:
path: CHANGELOG.md
- name: Set the version
run: |
DEV=${{ steps.get_version.outputs.version }}
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" config/fancymenu/customization/tfg_version.txt
- name: Move
run: |
rsync -av --exclude-from='.github/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: Archive MMC
run: |
zip -r ./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-mmc.zip mmc-pack.json instance.cfg .minecraft/
cd ./extended/
zip -r ../TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-mmc-extended.zip mmc-pack.json instance.cfg .minecraft/
- name: Archive CF
run: |
mv -vf .minecraft/ overrides/
zip -r ./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-cf.zip manifest.json modlist.html overrides/bansoukou/ overrides/resourcepacks/ overrides/config/ overrides/groovy/ overrides/scripts/
cd ./extended/
mv -vf .minecraft/ overrides/
zip -r ../TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-cf-extended.zip manifest.json modlist.html overrides/bansoukou/ overrides/resourcepacks/ overrides/config/ overrides/groovy/ overrides/scripts/
- name: Archive Server
run: |
cp -r .github/buildtools/serverfiles/* overrides/
cp -r .github/buildtools/serverfiles/* extended/overrides/
cd ./overrides/
cat ./.github/buildtools/client_mod.txt | while read -r line; do find mods -name "$line" -delete; done
rm -rf resourcepacks config/txloader
zip -r ../TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-server.zip ./
cd ../extended/overrides/
cat ../../.github/buildtools/client_mod.txt | while read -r line; do find mods -name "$line" -delete; done
rm -rf resourcepacks config/txloader
zip -r ../../TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-server-extended.zip ./
- name: Create GitHub Release
uses: softprops/action-gh-release@v0.1.15
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: false
generate_release_notes: true
name: Release ${{ steps.changelog.outputs.version }}
body: ${{ steps.changelog.outputs.description }}
files: |
./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-cf.zip
./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-cf-extended.zip
./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-mmc.zip
./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-mmc-extended.zip
./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-server.zip
./TerraFirmaGreg-1.12-${{ steps.get_version.outputs.version }}-server-extended.zip