Skip to content

Workflow file for this run

name: Deploy preview modpack
on:
push:
tags:
- '*-pr-*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get the version
run: |
echo VERSION=$(echo ${GITHUB_REF} | sed -e 's#refs/tags/##g' | awk -F'-' '{print $1}') >> $GITHUB_ENV
echo PR_VERSION=$(echo ${GITHUB_REF} | sed -e 's#refs/tags/##g' | awk -F'-' '{print $3}') >> $GITHUB_ENV
- name: Set the version
run: |
MODPACKVERSION=${{ env.VERSION }}
sed -i -e "s/MODPACKVERSION/${MODPACKVERSION}/g" ./manifest.json
sed -i -e "s/MODPACKVERSION/${MODPACKVERSION}/g" ./instance.cfg
- name: Archive Release CF
run: |
zip -r ./GTExpert-${{ env.VERSION }}-pr-${{ env.PR_VERSION }}-cf.zip ./manifest.json ./modlist.html ./overrides/config/ ./overrides/scripts/
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./buildtools/requirements.txt
- name: Run Python
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: python buildtools/mod-install.py
- name: Archive Release MMC
run: |
mv -vf ./overrides/ .minecraft/
zip -r ./GTExpert-${{ env.VERSION }}-pr-${{ env.PR_VERSION }}-mmc.zip ./mmc-pack.json ./instance.cfg .minecraft/
- name: Move Server Files
run: |
mv -vf ./serverfiles/* ./
- name: Archive Release Server
run: |
mv -vf .minecraft/* ./
zip -r ./GTExpert-${{ env.VERSION }}-pr-${{ env.PR_VERSION }}-server.zip ./docker-compose.yml ./PleaseRead.txt ./Install.bat ./Install.sh ./ServerStart.bat ./ServerStart.sh ./settings.bat ./settings.sh ./TmuxServer.sh ./bansoukou/ ./config/ ./mods/ ./scripts/
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
prerelease: true
generate_release_notes: true
files: |
./GTExpert-${{ env.VERSION }}-pr-${{ env.PR_VERSION }}-cf.zip
./GTExpert-${{ env.VERSION }}-pr-${{ env.PR_VERSION }}-mmc.zip
./GTExpert-${{ env.VERSION }}-pr-${{ env.PR_VERSION }}-server.zip