Skip to content

Deploy Questbook

Deploy Questbook #1

name: Deploy Questbook
permissions:
contents: write
deployments: write
on:
workflow_dispatch:
inputs:
version:
description: 'Modpack version'
required: true
env:
VERSION: "v${{ github.event.inputs.version }}"
NAME: "GTExpert2"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check if tag already exists
run: |
if git rev-parse --verify --quiet "${{ env.VERSION }}"; then
echo "Version ${{ github.event.inputs.version }} already exists, aborting workflow."
exit 1
fi
- name: Download quest zip
run: |
wget -O questbook.zip https://github.com/GTModpackTeam/GregTech-Expert-2-FTBQuestBook/archive/refs/heads/main.zip
unzip questbook.zip
mkdir ./ftbquests/
mv -vf ./GregTech-Expert-2-FTBQuestBook-main/* ./ftbquests/
rm -rf ./GregTech-Expert-2-FTBQuestBook-main/ ./questbook.zip
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./buildtools/questbook/requirements.txt
- name: Run Python
env:
DEEPL_AUTH_KEY: ${{ secrets.DEEPL_AUTH_KEY }}
run: python ./buildtools/questbook/translate.py
- name: Archive Release
run: |
zip -r ./${{ env.NAME }}-${{ env.VERSION }}-ftbquests.zip ./ftbquests-tl/
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ env.VERSION }}"
draft: false
prerelease: false
generate_release_notes: true
files: |
./${{ env.NAME }}-${{ env.VERSION }}-ftbquests.zip