Skip to content

Commit

Permalink
added versioning of tutorials sub repository
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf2323 committed Nov 1, 2023
1 parent 3d800f7 commit 015e4e7
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 16 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ jobs:
DATE="$(date +%Y-%m-%d)"
sed -i "s~\${maven\.build\.timestamp}~$DATE~g" ./CHANGELOG.md
echo "$(cat ./CHANGELOG.md)" >> './docs/Documentation/CHANGELOG.md'
- name: Set ref in download commands
run: |
GIT_SHA="$(cd docs/_tutorials && git rev-parse HEAD)"
if [ $VERSION_TYPE == 'release' ]; then REFERENCE="${{ github.ref }}"; else REFERENCE="${GIT_SHA}" fi
find docs -type f -exec sed -i "s#/bq download BetonQuest/Quest-Tutorials \${ref} QuestPackages #/bq download BetonQuest/Quest-Tutorials ${REFERENCE} QuestPackages #" {} +
- name: Set user feedback form version in mkdocs.yml
run: |
sed -i "s~%VERSION%~${VERSION}~g" ./mkdocs.yml
Expand Down Expand Up @@ -290,7 +295,6 @@ jobs:
echo "upload_path=$UPLOAD_PATH" >> $GITHUB_OUTPUT
env:
REPOSITORY_URL: ${{ vars.REPOSITORY_URL }}

deploy-docs:
name: Deploy Docs
concurrency: gh-pages-deploy
Expand All @@ -309,6 +313,7 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: ${{ env.VERSION_TYPE == 'release' }}
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
Expand Down Expand Up @@ -386,6 +391,15 @@ jobs:
mike delete "$TWO_DIGIT_VERSION-DEV"
fi
mike deploy "${FLAGS[@]}" "${VERSION[@]}"
- name: Set version Tag for Quest-Tutorials submodule
if: "env.VERSION_TYPE == 'release'"
run: |
git config --global user.name "BetonQuest-Bot"
git config --global user.email "[email protected]"
cd docs/_tutorials
git tag v${VERSION}
git push origin v${VERSION}
create-release:
name: Create GitHub Release
if: "needs.prepare.outputs.VERSION_TYPE == 'release' && needs.deploy-artifacts.result == 'success' && needs.deploy-docs.result == 'success'"
Expand Down
10 changes: 5 additions & 5 deletions docs/Tutorials/Getting-Started/Basics/Conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In this tutorial you will learn how to create and use conditions!
</div>
@snippet:tutorials:download-setup-warning@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Conditions/1-DirectoryStructure /tutorialQuest
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Conditions/1-DirectoryStructure /tutorialQuest
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/tutorialQuest_"
Expand Down Expand Up @@ -94,7 +94,7 @@ If it is day it should show true and if it is night, false.

@snippet:tutorials:download-solution@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Conditions/2-FirstCondition /tutorialQuest overwrite
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Conditions/2-FirstCondition /tutorialQuest overwrite
```

## 4. Integrating conditions into objectives
Expand Down Expand Up @@ -227,7 +227,7 @@ and won't give you more!

@snippet:tutorials:download-solution@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Conditions/3-ConditionsInConversations /tutorialQuest overwrite
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Conditions/3-ConditionsInConversations /tutorialQuest overwrite
```

### 5.2. Limiting the town tour as well
Expand All @@ -239,7 +239,7 @@ using the method you just learned.
:warning: _This will overwrite any changes (including NPC ID's and locations) you have made to the example.<br>_
Linking NPCs to conversations is explained in the [basics tutorial](./Conversations.md#1-linking-a-conversation-to-a-npc).
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Conditions/4-JackCompleted /tutorialQuest overwrite
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Conditions/4-JackCompleted /tutorialQuest overwrite
```

### 5.3. Making the Blacksmith only trade the armor once
Expand Down Expand Up @@ -370,7 +370,7 @@ in the `items` section of your "_package.yml_" file.

@snippet:tutorials:download-solution@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Conditions/5-FullExample /tutorialQuest overwrite
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Conditions/5-FullExample /tutorialQuest overwrite
```

## 6. Conditions in Events
Expand Down
2 changes: 1 addition & 1 deletion docs/Tutorials/Getting-Started/Basics/Conversations.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and a NPC. Therefore, these are the basic tool for story telling.

@snippet:tutorials:download-setup@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Conversations/1-DirectoryStructure /tutorialQuest overwrite
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Conversations/1-DirectoryStructure /tutorialQuest overwrite
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/tutorialQuest_"
Expand Down
6 changes: 3 additions & 3 deletions docs/Tutorials/Getting-Started/Basics/Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In this tutorial, we will give the player items and teleport them to different l
</div>
@snippet:tutorials:download-setup-warning@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Conversations/1-DirectoryStructure /tutorialQuest
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Conversations/1-DirectoryStructure /tutorialQuest
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/tutorialQuest_"
Expand Down Expand Up @@ -130,7 +130,7 @@ You can also run this command from the console (without the slash at the start).

@snippet:tutorials:download-solution@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Events/1-FirstEvent /tutorialQuest overwrite
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Events/1-FirstEvent /tutorialQuest overwrite
```


Expand Down Expand Up @@ -209,7 +209,7 @@ Now speak with the NPC again to take the tour.

@snippet:tutorials:download-solution@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Events/2-TownTour /tutorialQuest overwrite
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Events/2-TownTour /tutorialQuest overwrite
```

## Summary
Expand Down
4 changes: 2 additions & 2 deletions docs/Tutorials/Getting-Started/Basics/Objectives.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fishing fish. The possibilities are nearly endless! You will learn about these i
</div>
@snippet:tutorials:download-setup-warning@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Objectives/1-DirectoryStructure /tutorialQuest
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Objectives/1-DirectoryStructure /tutorialQuest
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/tutorialQuest_"
Expand Down Expand Up @@ -203,7 +203,7 @@ the dialog to the npc in "_package.yml_". If not, [check the previous tutorials]

@snippet:tutorials:download-solution@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Basics/Objectives/2-FullExample /tutorialQuest
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Basics/Objectives/2-FullExample /tutorialQuest
```

## Summary
Expand Down
8 changes: 4 additions & 4 deletions docs/Tutorials/Syntax/Quest-Packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Then play around with this system to get a feel for it.

@snippet:tutorials:download-complete-files@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Syntax/packageStructure/1-MultiFileStructure /packageStructure/MultiFile
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Syntax/packageStructure/1-MultiFileStructure /packageStructure/MultiFile
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/packageStructure/MultiFile_"
Expand Down Expand Up @@ -277,7 +277,7 @@ Instead, a new folder will be created in the previous package.

@snippet:tutorials:download-complete-files@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Syntax/packageStructure/2-SingleFileStructure /packageStructure/SingleFile
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Syntax/packageStructure/2-SingleFileStructure /packageStructure/SingleFile
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/packageStructure/SingleFile_"
Expand Down Expand Up @@ -311,7 +311,7 @@ By creating a folder with a _package.yml_ file inside another package, you creat

@snippet:tutorials:download-complete-files@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Syntax/packageStructure/3-PackageInPackage /packageStructure/PackageInPackage
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Syntax/packageStructure/3-PackageInPackage /packageStructure/PackageInPackage
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/packageStructure/PackageInPackage_"
Expand Down Expand Up @@ -343,7 +343,7 @@ in the directory tree.

@snippet:tutorials:download-complete-files@
```
/bq download BetonQuest/Quest-Tutorials main QuestPackages /Syntax/packageStructure/4-SubDirectory /packageStructure/SubDirectory
/bq download BetonQuest/Quest-Tutorials ${ref} QuestPackages /Syntax/packageStructure/4-SubDirectory /packageStructure/SubDirectory
```
You can now find all files needed for this tutorial in this location:
"_YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/packageStructure/SubDirectory_"
Expand Down

0 comments on commit 015e4e7

Please sign in to comment.