Skip to content

Deploy Modpack

Deploy Modpack #8

Workflow file for this run

name: Deploy Modpack
permissions:
contents: read
deployments: write
on:
workflow_dispatch:
inputs:
version:
description: "Modpack version"
required: true
release_type:
description: "Release type"
type: choice
default: "release"
options: [release, beta, alpha]
env:
NAME: "GTExpert"
JAVA8_CF: "${{ github.event.inputs.version }}-CF_Java_8"
JAVA8_MMC: "${{ github.event.inputs.version }}-MMC_Java_8"
JAVA8_SERVER: "${{ github.event.inputs.version }}-Server_Java_8"
jobs:
build:
runs-on: ubuntu-slim
strategy:
matrix:
buildType: [standard]
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Build Environment
uses: ./.github/actions/build_setup
- name: Create artifacts directory
run: mkdir -p artifacts
- name: Set Modpack Version
run: |
sed -i -e "s/MODPACKVERSION/v${{ github.event.inputs.version }}/g" ./manifest.json
sed -i -e "s/MODPACKVERSION/v${{ github.event.inputs.version }}/g" ./instance.cfg
- name: Install Mods
env:
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
run: uv run --directory ./buildtools python ./mod-install.py
- name: Clean up placeholder files
run: find . -name ".gitkeep" -delete
- name: Package Artifacts
run: |
zip -r artifacts/${{ env.NAME }}-${{ env.JAVA8_CF }}.zip manifest.json modlist.html overrides/config/ overrides/mods/ overrides/scripts/
mv overrides/ .minecraft/
zip -r artifacts/${{ env.NAME }}-${{ env.JAVA8_MMC }}.zip mmc-pack.json instance.cfg .minecraft/
mv serverfiles/* ./
mv -vf .minecraft/* ./
zip -r artifacts/${{ env.NAME }}-${{ env.JAVA8_SERVER }}.zip docker-compose.yml PleaseRead.txt Install.* ServerStart.* settings.* TmuxServer.sh config/ mods/ scripts/
- name: Upload Artifacts
uses: actions/upload-artifact@v5
with:
name: ${{ matrix.buildType }}-artifacts
path: artifacts/
retention-days: 1
release:
needs: build
runs-on: ubuntu-slim
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Download All Artifacts
uses: actions/download-artifact@v6
with:
path: artifacts
merge-multiple: true
- name: Check or create tag
run: |
git config --global user.name "github-actions"
git config --global user.email "actions@github.com"
git tag ${{ env.JAVA8_CF }}
git push origin ${{ env.JAVA8_CF }}
- name: Create or Update GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ github.event.inputs.version }}-${{ github.event.inputs.release_type }}"
name: "v${{ github.event.inputs.version }}-${{ github.event.inputs.release_type }}"
prerelease: false
generate_release_notes: true
files: |
artifacts/${{ env.NAME }}-${{ env.JAVA8_CF }}.zip
artifacts/${{ env.NAME }}-${{ env.JAVA8_MMC }}.zip
artifacts/${{ env.NAME }}-${{ env.JAVA8_SERVER }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}