Skip to content

Commit

Permalink
Initial CI work
Browse files Browse the repository at this point in the history
  • Loading branch information
thetestgame committed Feb 22, 2022
1 parent daf423b commit abfc9c5
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 17 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Primary workflow for building, testing, and deploying the Toontown Classic OTP server packages
name: Toontown Classic OTP CI
on:
# Release a new static anytime a release change is published to the repository
push:
branches:
- '*' # matches every branch that doesn't contain a '/'
- '*/*' # matches every branch containing a single '/'
- '**' # matches every branch
- '!gh-pages' # excludes gh-pages

# Create a latest image and deploy changes to Github Pages on a version publish
release:
types: [published]

# Allow manual deployments from Github's UI/API
workflow_dispatch:

# Define workflow constants as environment variables
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
# Publishes the download server Docker images to all supported repositories
push_to_registries:
name: Push Docker Images

# The type of runner that the job will run on
runs-on: ubuntu-latest

# Define the job's permissions
permissions:
packages: write
contents: read

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out the release branch of the repository under $GITHUB_WORKSPACE
- name: Check out the repo
uses: actions/checkout@v2

# Authenticate with the Github packages registry prior to staticing/pushing
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata about this job execution and pack it into the various outgoing Docker images
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Deploy our created Docker images to the supported registries
- name: build and push Docker images
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ databases/

# Other
resources/

# Allow contents of .github
!.github/
!.github/**/*.yml
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:2.7.18

# Copy server and resource directories into Docker image
COPY . /server
WORKDIR /server

# Install our pip dependencies
RUN pip install -r requirements.txt

# Expose our networking ports
EXPOSE 6667
EXPOSE 7100

# Start the OTP application
ENTRYPOINT ["python"]
CMD ["-m", "realtime"]
2 changes: 1 addition & 1 deletion linux/start_otp.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
cd ..
/usr/bin/python2 -m realtime.main
/usr/bin/python2 -m realtime
4 changes: 2 additions & 2 deletions linux/start_otp_screen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
cd ..
screen python -m realtime.main --no-clientagent --no-stateserver --no-database
screen python -m realtime.main --no-messagedirector
screen python -m realtime --no-clientagent --no-stateserver --no-database
screen python -m realtime --no-messagedirector
File renamed without changes.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ semidbm
simplejson
pyyaml
pytoml
panda3d
17 changes: 3 additions & 14 deletions win32/start_otp.bat
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
@echo off

rem Choose correct python command to execute the OTP
rem ppythona -h >nul 2>&1 && (
rem set PYTHON_CMD=ppythona
rem ) || (
rem set PYTHON_CMD=ppython
rem )

rem A Temporary Solution as you HAVE to use a 64 bit Panda with the current database.
set PYTHON_CMD=C:\Panda3D-1.11.0-x64-astron\python\ppython.exe

title Toontown Classic - OTP
cd ../

rem Start the OTP using the PYTHON_CMD variable
:main
%PYTHON_CMD% -m realtime.main
python -m realtime
pause
goto :main
goto :main

0 comments on commit abfc9c5

Please sign in to comment.