added actions workflows

This commit is contained in:
Seaswimmer 2024-03-21 14:50:54 -04:00
parent b4d510df2b
commit 53009ecb84
Signed by: cswimr
GPG key ID: B8953EC01E5C4063
9 changed files with 295 additions and 0 deletions

View file

@ -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 <commit_message>" ]; 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

View file

@ -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/

View file

@ -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 <commit_message>")

BIN
build/atlauncher/.minecraft/unsup.jar (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -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

View file

@ -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
}

4
build/prism/instance.cfg Normal file
View file

@ -0,0 +1,4 @@
[General]
ConfigVersion=1.2
name=Azure Undead Modpack
InstanceType=OneSix

43
build/prism/mmc-pack.json Normal file
View file

@ -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
}

View file

@ -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"
}
]
}