diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-build.yml similarity index 82% rename from .github/workflows/dev-release.yml rename to .github/workflows/dev-build.yml index 6b5d470..8dfeb83 100644 --- a/.github/workflows/dev-release.yml +++ b/.github/workflows/dev-build.yml @@ -1,6 +1,10 @@ -name: Dev Release +name: Dev Build + +on: + push: + branches-ignore: + - release -on: [push] jobs: dev-release: strategy: @@ -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 @@ -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/ \ No newline at end of file diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 0000000..da39def --- /dev/null +++ b/.github/workflows/release-build.yml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/release-ghcr.yml b/.github/workflows/release-ghcr.yml new file mode 100644 index 0000000..b41eafe --- /dev/null +++ b/.github/workflows/release-ghcr.yml @@ -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 }}" \ No newline at end of file diff --git a/build_executable.ps1 b/build_executable.ps1 index 560ae1d..776cc63 100644 --- a/build_executable.ps1 +++ b/build_executable.ps1 @@ -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 diff --git a/docker/Dockerfile b/docker/Dockerfile index d9b7732..b8eaed9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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"] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 0da5606..566626b 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -17,7 +17,7 @@ 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 @@ -25,9 +25,8 @@ 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'" diff --git a/frontend/palworld-pal-editor-webui/src/components/PalEditor.vue b/frontend/palworld-pal-editor-webui/src/components/PalEditor.vue index 759de13..a4990fd 100644 --- a/frontend/palworld-pal-editor-webui/src/components/PalEditor.vue +++ b/frontend/palworld-pal-editor-webui/src/components/PalEditor.vue @@ -37,28 +37,28 @@ function filterInvalid(list) {

- {{ palStore.getTranslatedText("Editor_1") }} + {{ palStore.getTranslatedText("Editor_Note_Ghost_Pal") }}

- {{ palStore.getTranslatedText("Editor_2") }} + {{ palStore.getTranslatedText("Editor_Basic_Info") }}

- {{ palStore.getTranslatedText("Editor_3") }} + {{ palStore.getTranslatedText("Editor_Species") }} {{ palStore.displayPalElement(palStore.SELECTED_PAL_DATA.DataAccessKey) }} {{ palStore.PAL_STATIC_DATA[palStore.SELECTED_PAL_DATA.DataAccessKey]?.I18n || palStore.SELECTED_PAL_DATA.DataAccessKey }}

@@ -76,7 +76,7 @@ function filterInvalid(list) {

- {{ palStore.getTranslatedText("Editor_4") }} + {{ palStore.getTranslatedText("Editor_Nickname") }}

@@ -86,7 +86,7 @@ function filterInvalid(list) {

- {{ palStore.getTranslatedText("Editor_5") }} + {{ palStore.getTranslatedText("Editor_Gender") }} {{ palStore.SELECTED_PAL_DATA.displayGender() }}

- 🆔 {{ palStore.getTranslatedText("Editor_7") }} + 🆔 {{ palStore.getTranslatedText("Editor_Pal_ID") }} {{ palStore.SELECTED_PAL_ID }}

- 🏘️ {{ palStore.getTranslatedText("Editor_8") }} + 🏘️ {{ palStore.getTranslatedText("Editor_Pal_Guild_ID") }} {{ palStore.SELECTED_PAL_DATA.group_id }}

- 📦 {{ palStore.getTranslatedText("Editor_9") }} + 📦 {{ palStore.getTranslatedText("Editor_Pal_Slot") }} {{ palStore.SELECTED_PAL_DATA.ContainerId }} @ {{ palStore.SELECTED_PAL_DATA.SlotIndex }}

- 🗿 {{ palStore.getTranslatedText("Editor_10") }} + 🗿 {{ palStore.getTranslatedText("Editor_Pal_Owner") }} {{ palStore.SELECTED_PAL_DATA.OwnerName || - palStore.getTranslatedText("Editor_11") }} + palStore.getTranslatedText("Editor_Pal_No_Owner") }}

- ❤️ {{ palStore.getTranslatedText("Editor_12") }} + ❤️ {{ palStore.getTranslatedText("Editor_Estimated_HP") }} {{ palStore.SELECTED_PAL_DATA.ComputedMaxHP / 1000 }}

- ⚔️ {{ palStore.getTranslatedText("Editor_13") }} + ⚔️ {{ palStore.getTranslatedText("Editor_Estimated_ATK") }} {{ palStore.SELECTED_PAL_DATA.ComputedAttack }}

- 🛡️ {{ palStore.getTranslatedText("Editor_14") }} + 🛡️ {{ palStore.getTranslatedText("Editor_Estimated_DEF") }} {{ palStore.SELECTED_PAL_DATA.ComputedDefense }}

- 🔨 {{ palStore.getTranslatedText("Editor_15") }} + 🔨 {{ palStore.getTranslatedText("Editor_Estimated_WorkSpeed") }} {{ palStore.SELECTED_PAL_DATA.ComputedCraftSpeed }}

@@ -164,23 +164,23 @@ function filterInvalid(list) {

- {{ palStore.getTranslatedText("Editor_16") }} + {{ palStore.getTranslatedText("Editor_IV") }}

- ❤️ {{ palStore.getTranslatedText("Editor_17") }} + ❤️ {{ palStore.getTranslatedText("Editor_IV_HP") }} {{ palStore.SELECTED_PAL_DATA.Talent_HP }}

- 🛡️ {{ palStore.getTranslatedText("Editor_18") }} + 🛡️ {{ palStore.getTranslatedText("Editor_IV_DEF") }} {{ palStore.SELECTED_PAL_DATA.Talent_Defense }}

- ⚔️ {{ palStore.getTranslatedText("Editor_19") }} + ⚔️ {{ palStore.getTranslatedText("Editor_IV_ATK") }} {{ palStore.SELECTED_PAL_DATA.Talent_Shot }}

- {{ palStore.getTranslatedText("Editor_20") }} + {{ palStore.getTranslatedText("Editor_IV_MELEE") }} {{ palStore.SELECTED_PAL_DATA.Talent_Melee }}


- {{ palStore.getTranslatedText("Editor_21") }} + {{ palStore.getTranslatedText("Editor_Souls_Upgrade") }}

- ❤️ {{ palStore.getTranslatedText("Editor_22") }} + ❤️ {{ palStore.getTranslatedText("Editor_Souls_HP") }} {{ palStore.SELECTED_PAL_DATA.Rank_HP }}

- ⚔️ {{ palStore.getTranslatedText("Editor_23") }} + ⚔️ {{ palStore.getTranslatedText("Editor_Souls_ATK") }} {{ palStore.SELECTED_PAL_DATA.Rank_Attack }}

- 🛡️ {{ palStore.getTranslatedText("Editor_24") }} + 🛡️ {{ palStore.getTranslatedText("Editor_Souls_DEF") }} {{ palStore.SELECTED_PAL_DATA.Rank_Defence }}

- 🔨 {{ palStore.getTranslatedText("Editor_25") }} + 🔨 {{ palStore.getTranslatedText("Editor_Souls_CraftSpeed") }} {{ palStore.SELECTED_PAL_DATA.Rank_CraftSpeed }}


- {{ palStore.getTranslatedText("Editor_26") }} + {{ palStore.getTranslatedText("Editor_Condenser") }}

- {{ palStore.getTranslatedText("Editor_27") }} + ⭐ {{ palStore.getTranslatedText("Editor_Condenser_Rank") }} {{ palStore.SELECTED_PAL_DATA.Rank - 1 }}

- {{ palStore.getTranslatedText("Editor_28") }} + {{ palStore.getTranslatedText("Editor_Passive_Skills") }}

@@ -285,7 +285,7 @@ function filterInvalid(list) {