Skip to content

Commit

Permalink
Merge 0.8.0 into QWebEngineView
Browse files Browse the repository at this point in the history
  • Loading branch information
KrisCris committed Apr 26, 2024
2 parents 754dd4f + 70fbc4c commit e6f1101
Show file tree
Hide file tree
Showing 35 changed files with 863 additions and 451 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Dev Release
name: Dev Build

on:
push:
branches-ignore:
- release

on: [push]
jobs:
dev-release:
strategy:
Expand All @@ -13,7 +17,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12.2
architecture: x64
Expand All @@ -34,7 +38,7 @@ jobs:
run: ./build_executable.sh

- name: Upload artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Palworld_Pal_Editor_${{ matrix.os }}_artifact
path: ./dist/
path: ./dist/
54 changes: 54 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release Build

on:
push:
branches:
- release
tags:
- "v*"

jobs:
dev-release:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12.2
architecture: x64

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Run Windows Builder Script
if: runner.os == 'Windows'
shell: pwsh
run: ./build_executable.ps1

- name: Run Unix-like Builder Script
if: runner.os != 'Windows'
shell: bash
run: ./build_executable.sh

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Palworld_Pal_Editor_${{ matrix.os }}_artifact
path: ./dist/

- name: Create and Upload Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/release-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Push Docker image

on:
push:
branches:
- release
tags:
- "v*"

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Lowercase repository owner
run: echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
tags: ghcr.io/${{ env.REPO_OWNER }}/palworld-pal-editor:latest
platforms: linux/amd64,linux/arm64

- name: Verify image digest
run: echo "The new image digest is ${{ steps.build-and-push.outputs.digest }}"
3 changes: 2 additions & 1 deletion build_executable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ cd ".\frontend\palworld-pal-editor-webui"
cd "..\..\"
# Move the build directory
Remove-Item ".\src\palworld_pal_editor\webui" -Recurse -Force
Move-Item -Path ".\frontend\palworld-pal-editor-webui\dist" -Destination ".\src\palworld_pal_editor\webui" -Force
New-Item -Path ".\src\palworld_pal_editor\webui" -ItemType "directory"
Move-Item -Path ".\frontend\palworld-pal-editor-webui\dist\*" -Destination ".\src\palworld_pal_editor\webui" -Force


# Determine the appropriate Python command
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ COPY ./ /app
# Copy the entrypoint script into the image and make it executable
COPY ./docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN chmod +x /app/setup_and_run.sh

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
7 changes: 3 additions & 4 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ chown -R pn:pn /app



cmd="gosu pn ./setup_and_run.sh"
cmd="./setup_and_run.sh --nocli"

# Check each environment variable and append it to the command if it exists
if [ -n "$APP_LANG" ]; then cmd="$cmd --lang=\"$APP_LANG\""; fi
if [ -n "$APP_PORT" ]; then cmd="$cmd --port=$APP_PORT"; fi
if [ -n "$MODE" ]; then cmd="$cmd --mode=\"$MODE\""; fi
if [ -n "$SAVE_PATH" ]; then cmd="$cmd --path=\"$SAVE_PATH\""; fi
if [ -n "$PASSWORD" ]; then cmd="$cmd --password=\"$PASSWORD\""; fi
# if [ -n "$PY_INTERACTIVE_FLAG" ]; then cmd="$cmd $PY_INTERACTIVE_FLAG"; fi
# if [ -n "$INTERACTIVE" ]; then cmd="$cmd --interactive"; fi

echo "Launching: $cmd"

# Execute the command
eval exec $cmd
eval exec "su pn -c '$cmd'"
Loading

0 comments on commit e6f1101

Please sign in to comment.