name: Deploy modpack preview on: push: tags: - "Pre*" 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/Pre} - name: Set the version run: | DEV=${{ steps.get_version.outputs.version }} sed -i -e "s/DEV/${DEV}/g" .github/buildtools/modpack/manifest.json sed -i -e "s/DEV/${DEV}/g" .github/buildtools/modpack/instance.cfg sed -i -e "s/DEV/${DEV}/g" config/fancymenu/customization/main_menu.txt sed -i -e "s/DEV/${DEV}/g" config/bcc-common.toml - name: Changelog Parser id: changelog uses: coditory/changelog-parser@v1.0.2 with: path: CHANGELOG.md - name: Submodule init run: | git submodule init cd mods git config --global credential.helper '!f() { echo "username=Xikaro"; echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f' git submodule update --recursive - name: Archive CF run: | cp -r {config,defaultconfigs,kubejs,mods} overrides/ zip -r ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-cf.zip .github/buildtools/modpack/manifest.json .github/buildtools/modpack/modlist.html overrides - name: Archive MMC run: | mv -vf overrides/ .minecraft/ zip -r ./TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-mmc.zip .github/buildtools/modpack/mmc-pack.json .github/buildtools/modpack/instance.cfg .minecraft/ - name: Archive Server run: | cp -r .github/buildtools/serverpack/* .minecraft/ cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done cd .minecraft/ zip -r ../TerraFirmaGreg-1.20.x-${{ steps.get_version.outputs.version }}-server.zip ./ - name: Create GitHub Release uses: softprops/action-gh-release@v0.1.15 if: startsWith(github.ref, 'refs/tags/') with: prerelease: true generate_release_notes: true name: ${{ steps.changelog.outputs.version }} body: ${{ steps.changelog.outputs.description }} files: | ./TerraFirmaGreg-1.20-${{ steps.get_version.outputs.version }}-cf.zip ./TerraFirmaGreg-1.20-${{ steps.get_version.outputs.version }}-mmc.zip ./TerraFirmaGreg-1.20-${{ steps.get_version.outputs.version }}-server.zip