From 53009ecb840f5de08013eec2d53e981a962dc435 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 21 Mar 2024 14:50:54 -0400 Subject: [PATCH] added actions workflows --- .forgejo/workflows/autotagger.yaml | 55 +++++++++++++ .forgejo/workflows/build.yaml | 81 +++++++++++++++++++ .forgejo/workflows/scripts/message.py | 20 +++++ build/atlauncher/.minecraft/unsup.jar | 3 + build/atlauncher/instance.cfg | 38 +++++++++ build/atlauncher/mmc-pack.json | 39 +++++++++ build/prism/instance.cfg | 4 + build/prism/mmc-pack.json | 43 ++++++++++ build/prism/patches/com.unascribed.unsup.json | 12 +++ 9 files changed, 295 insertions(+) create mode 100644 .forgejo/workflows/autotagger.yaml create mode 100644 .forgejo/workflows/build.yaml create mode 100644 .forgejo/workflows/scripts/message.py create mode 100644 build/atlauncher/.minecraft/unsup.jar create mode 100644 build/atlauncher/instance.cfg create mode 100644 build/atlauncher/mmc-pack.json create mode 100644 build/prism/instance.cfg create mode 100644 build/prism/mmc-pack.json create mode 100644 build/prism/patches/com.unascribed.unsup.json diff --git a/.forgejo/workflows/autotagger.yaml b/.forgejo/workflows/autotagger.yaml new file mode 100644 index 0000000..d57af68 --- /dev/null +++ b/.forgejo/workflows/autotagger.yaml @@ -0,0 +1,55 @@ +name: Autotagger +on: + push: + branches: + - 'main' + +jobs: + Autotagger: + runs-on: docker + container: catthehacker/ubuntu:act-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Git + run: | + git config --global user.name "SeaswimmerTheFsh" + git config --global user.email "seaswimmerthefsh@gmail.com" + + - name: Extract commit message + id: extract_commit_message + run: echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)" + + - name: Check commit message + id: check_commit_message + run: | + COMMIT_MESSAGE=$(echo "${{ steps.extract_commit_message.outputs.message }}") + OUTPUT=$(python .forgejo/workflows/scripts/message.py "$COMMIT_MESSAGE") + if [ "$OUTPUT" = "Usage: python message.py " ]; then + echo "Called without commit message!" + exit 1 + elif [ "$OUTPUT" = "None" ]; then + echo "No version bump." + echo "::set-output name=latest_tag::$(git describe --tags --abbrev=0)" + else + echo "Version bump detected: $OUTPUT" + echo "::set-output name=version::$OUTPUT" + fi + + - name: Create tag + if: steps.check_commit_message.outputs.version + run: | + VERSION=${{ steps.check_commit_message.outputs.version }} + git tag -a $VERSION -m "version bumped to $VERSION" + git push origin $VERSION + + - name: Update latest tag + if: steps.check_commit_message.outputs.latest_tag + run: | + COMMIT_MESSAGE=$(echo "${{ steps.extract_commit_message.outputs.message }}") + LATEST_TAG=${{ steps.check_commit_message.outputs.latest_tag }} + git tag -fa $LATEST_TAG -m "$COMMIT_MESSAGE" + git push origin $LATEST_TAG --force diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml new file mode 100644 index 0000000..20d743a --- /dev/null +++ b/.forgejo/workflows/build.yaml @@ -0,0 +1,81 @@ +name: Build +on: + push: + branches: + - 'main' + pull_request: + +jobs: + Documentation: + runs-on: docker + container: www.coastalcommits.com/galacticfactory/documentation:latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install dependencies + run: poetry install --no-root + + - name: Set environment variables + uses: actions/env@v2 + + - name: Build documentation + run: | + export SITE_URL="https://$CI_ACTION_REF_NAME_SLUG.docs.galacticfactory.cc" + export EDIT_URI="src/branch/$CI_ACTION_REF_NAME/docs" + mkdocs build -v + + - name: Deploy documentation + run: | + GREEN='\033[0;32m' + YELLOW='\033[0;33m' + BLUE='\033[0;34m' + + unset GITHUB_TOKEN + unset GITLAB_TOKEN + + echo "${YELLOW}Deploying to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}...\n" + + npx -p "@getmeli/cli" meli upload ./site \ + --url "https://pages.coastalcommits.com" \ + --site "${{ vars.MELI_SITE_ID }}" \ + --token "${{ secrets.MELI_SITE_SECRET }}" \ + --release "$CI_ACTION_REF_NAME_SLUG/${{ env.GITHUB_SHA }}" \ + --branch "$CI_ACTION_REF_NAME_SLUG" + + echo "\n${YELLOW}Deployed to ${BLUE}Meli ${YELLOW}on branch ${GREEN}$CI_ACTION_REF_NAME_SLUG${YELLOW}!" + echo "${GREEN}https://$CI_ACTION_REF_NAME_SLUG.docs.galacticfactory.cc/" + env: + GITEA_TOKEN: ${{ secrets.COASTALCOMMITSTOKEN }} + + Export Files: + runs-on: docker + container: catthehacker/ubuntu:act-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Copy export files + run: | + mkdir -vp /export/atlauncher/.minecraft + cp -vrT ./build/atlauncher /export/atlauncher + cp -vp ./unsup.ini /export/atlauncher/.minecraft/ + + mkdir -vp /export/prism/.minecraft + cp -vrT ./build/prism /export/prism + cp -v ./unsup.ini /export/prism/.minecraft/ + + - name: Upload ATLauncher export artifact + uses: actions/upload-artifact@v3 + with: + name: ATLauncher + path: /export/atlauncher/ + continue-on-error: true + + - name: Upload Prism Launcher export artifact + uses: actions/upload-artifact@v3 + with: + name: PrismLauncher + path: /export/prism/ diff --git a/.forgejo/workflows/scripts/message.py b/.forgejo/workflows/scripts/message.py new file mode 100644 index 0000000..606981c --- /dev/null +++ b/.forgejo/workflows/scripts/message.py @@ -0,0 +1,20 @@ +import re +import sys +from typing import Optional + +pattern = r"^(?:V|v)ersion\ bump(?:ed)?\ to\ ([0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9]+)?).*" + +def get_commit_message(string) -> Optional[str]: + m = re.match(pattern, string) + if m: + return m.group(1) + else: + return None + +if __name__ == "__main__": + if len(sys.argv) >= 2: + commit_message = sys.argv[1] + result = get_commit_message(commit_message) + print(result) + else: + print("Usage: python message.py ") diff --git a/build/atlauncher/.minecraft/unsup.jar b/build/atlauncher/.minecraft/unsup.jar new file mode 100644 index 0000000..8e782f5 --- /dev/null +++ b/build/atlauncher/.minecraft/unsup.jar @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c1331899c1f51488ba9760e303f04533e07b9b0192048c03e6937d93d0d62d0 +size 1066380 diff --git a/build/atlauncher/instance.cfg b/build/atlauncher/instance.cfg new file mode 100644 index 0000000..6a6e112 --- /dev/null +++ b/build/atlauncher/instance.cfg @@ -0,0 +1,38 @@ +#Exported by ATLauncher +#Wed Nov 15 21:18:55 GMT 2023 +notes= +LogPrePostOutput=true +WrapperCommand=null +LWJGLVersion= +ShowConsoleOnError=true +OverrideMCLaunchMethod=false +iconKey=default +MaxMemAlloc=4096 +OverrideNativeWorkarounds=false +PostExitCommand=null +MCLaunchMethod=LauncherPart +UseNativeGLFW=false +MinecraftWinHeight=480 +JVMArgs=-javaagent\:unsup.jar -XX\:+UnlockExperimentalVMOptions -XX\:+UseG1GC -XX\:G1NewSizePercent\=20 -XX\:G1ReservePercent\=20 -XX\:MaxGCPauseMillis\=50 -XX\:G1HeapRegionSize\=32M +OverrideJava=false +OverrideJavaArgs=true +LaunchMaximized=false +AutoCloseConsole=false +InstanceType=OneSix +OverrideCommands=false +lastLaunchTime= +totalTimePlayed=0 +UseNativeOpenAL=false +PermGen=256 +IntendedVersion= +JavaPath=C\:\\Program Files\\Eclipse Adoptium\\jdk-8.0.392.8-hotspot\\bin\\javaw.exe +OverrideJavaLocation=false +ForgeVersion=false +LiteloaderVersion= +OverrideMemory=false +PreLaunchCommand=null +name=Azure Undead Modpack +OverrideWindow=false +ShowConsole=false +MinecraftWinWidth=854 +OverrideConsole=false diff --git a/build/atlauncher/mmc-pack.json b/build/atlauncher/mmc-pack.json new file mode 100644 index 0000000..804e1a9 --- /dev/null +++ b/build/atlauncher/mmc-pack.json @@ -0,0 +1,39 @@ +{ + "components": [ + { + "cachedName": "LWJGL 3", + "cachedVersion": "3.3.1", + "cachedVolatile": true, + "dependencyOnly": true, + "uid": "org.lwjgl3", + "version": "3.3.1" + }, + { + "cachedName": "Minecraft", + "cachedRequires": [ + { + "equals": "3.3.1", + "suggests": "3.3.1", + "uid": "org.lwjgl3" + } + ], + "cachedVersion": "1.20.1", + "important": true, + "uid": "net.minecraft", + "version": "1.20.1" + }, + { + "cachedName": "Forge", + "cachedRequires": [ + { + "equals": "1.20.1", + "uid": "net.minecraft" + } + ], + "cachedVersion": "47.2.0", + "uid": "net.minecraftforge", + "version": "47.2.0" + } + ], + "formatVersion": 1 +} \ No newline at end of file diff --git a/build/prism/instance.cfg b/build/prism/instance.cfg new file mode 100644 index 0000000..1509629 --- /dev/null +++ b/build/prism/instance.cfg @@ -0,0 +1,4 @@ +[General] +ConfigVersion=1.2 +name=Azure Undead Modpack +InstanceType=OneSix diff --git a/build/prism/mmc-pack.json b/build/prism/mmc-pack.json new file mode 100644 index 0000000..488ef52 --- /dev/null +++ b/build/prism/mmc-pack.json @@ -0,0 +1,43 @@ +{ + "components": [ + { + "cachedName": "LWJGL 3", + "cachedVersion": "3.3.1", + "cachedVolatile": true, + "dependencyOnly": true, + "uid": "org.lwjgl3", + "version": "3.3.1" + }, + { + "cachedName": "Minecraft", + "cachedRequires": [ + { + "suggests": "3.3.1", + "uid": "org.lwjgl3" + } + ], + "cachedVersion": "1.20.1", + "important": true, + "uid": "net.minecraft", + "version": "1.20.1" + }, + { + "cachedName": "Forge", + "cachedRequires": [ + { + "equals": "1.20.1", + "uid": "net.minecraft" + } + ], + "cachedVersion": "47.2.0", + "uid": "net.minecraftforge", + "version": "47.2.0" + }, + { + "cachedName": "unsup", + "cachedVersion": "0.2.3", + "uid": "com.unascribed.unsup" + } + ], + "formatVersion": 1 +} diff --git a/build/prism/patches/com.unascribed.unsup.json b/build/prism/patches/com.unascribed.unsup.json new file mode 100644 index 0000000..de72b0c --- /dev/null +++ b/build/prism/patches/com.unascribed.unsup.json @@ -0,0 +1,12 @@ +{ + "formatVersion": 1, + "name": "GalacticFactory Updater (unsup)", + "uid": "com.unascribed.unsup", + "version": "0.2.3", + "+agents": [ + { + "name": "com.unascribed:unsup:0.2.3", + "url": "https://repo.sleeping.town" + } + ] +}