Skip to content

add tooltips for the unlock viewing cage button #37

add tooltips for the unlock viewing cage button

add tooltips for the unlock viewing cage button #37

Workflow file for this run

name: Release Build
on:
push:
tags:
- "*"
jobs:
release-build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- 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: Extract Project Name
shell: bash
id: extract_project_name
run: |
PROJECT_NAME=$(cat pyproject.toml | grep "^name" | awk -F'"' '{print $2}')
if [[ -z "$PROJECT_NAME" ]]; then
echo "Error: Could not extract project name from pyproject.toml"
exit 1
fi
echo "PROJECT_NAME=$PROJECT_NAME" >> $GITHUB_ENV
- name: Set Build Metadata
shell: bash
run: |
CONFIG_FILE="src/palworld_pal_editor/config.py"
PYPROJECT_FILE="./pyproject.toml"
VERSION_TAG=$(git describe --tags --abbrev=0)
RELEASE_TYPE="RELEASE"
GIT_HASH=$(git rev-parse --short HEAD)
BUILD_TIME=$(date +%s)
REPO_OWNER="${{ github.repository_owner }}"
REPO_NAME="${{ github.event.repository.name }}"
BRANCH_NAME="${{ github.ref_name }}"
REPO="${REPO_OWNER}/${REPO_NAME}@${BRANCH_NAME}"
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV
if [[ "$RUNNER_OS" == "macOS" ]]; then
sed -i '' "s|^VERSION = .*|VERSION = \"${VERSION_TAG}\"|" $CONFIG_FILE
sed -i '' "s|^RELEASE_TYPE = .*|RELEASE_TYPE = \"${RELEASE_TYPE}\"|" $CONFIG_FILE
sed -i '' "s|^BUILD_TIME = .*|BUILD_TIME = \"${BUILD_TIME}\"|" $CONFIG_FILE
sed -i '' "s|^GIT_HASH = .*|GIT_HASH = \"${GIT_HASH}\"|" $CONFIG_FILE
sed -i '' "s|^REPO = .*|REPO = \"${REPO}\"|" $CONFIG_FILE
sed -i '' "s|^version = .*|version = \"${VERSION_TAG}\"|" $PYPROJECT_FILE
else
sed -i "s|^VERSION = .*|VERSION = \"${VERSION_TAG}\"|" $CONFIG_FILE
sed -i "s|^RELEASE_TYPE = .*|RELEASE_TYPE = \"${RELEASE_TYPE}\"|" $CONFIG_FILE
sed -i "s|^BUILD_TIME = .*|BUILD_TIME = \"${BUILD_TIME}\"|" $CONFIG_FILE
sed -i "s|^GIT_HASH = .*|GIT_HASH = \"${GIT_HASH}\"|" $CONFIG_FILE
sed -i "s|^REPO = .*|REPO = \"${REPO}\"|" $CONFIG_FILE
sed -i "s|^version = .*|version = \"${VERSION_TAG}\"|" $PYPROJECT_FILE
fi
cat $CONFIG_FILE
cat $PYPROJECT_FILE
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^)
COMPARE_URL="https://github.com/${REPO_OWNER}/${REPO_NAME}/compare/${LAST_TAG}...${VERSION_TAG}"
echo "COMPARE_URL=$COMPARE_URL" >> $GITHUB_ENV
- name: Windows Build
if: runner.os == 'Windows'
shell: pwsh
run: |
./build_executable.ps1
- name: Unix-like Build
if: runner.os != 'Windows'
shell: bash
run: |
./build_executable.sh
- name: Rename Built File
shell: bash
run: |
FILE_EXT=""
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
FILE_EXT=".exe"
fi
FILE_PATH="./dist/${{ env.PROJECT_NAME }}${FILE_EXT}"
if [[ ! -f "$FILE_PATH" ]]; then
echo "Error: Built file not found: $FILE_PATH"
exit 1
fi
NEW_NAME="Palworld-Pal-Editor_${{ runner.os }}_${{ env.VERSION_TAG }}_${{ env.GIT_HASH }}${FILE_EXT}"
mv "$FILE_PATH" "./dist/$NEW_NAME"
echo "Renamed file to: $NEW_NAME"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "Palworld-Pal-Editor_${{ runner.os }}_${{ env.VERSION_TAG }}"
path: ./dist/
- name: Create and Upload Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/*
body: |
## Changes
View the changes between versions [here](${{ env.COMPARE_URL }}).
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}