Updated submodules #3285
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Emscripten CI | |
on: | |
push: | |
branches: | |
- main | |
- devel | |
- versus-ci-emscripten | |
- stable-1.3.6.x | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: "${{ matrix.config.name }} | ${{ matrix.config.build_type }}" | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
# ======================================= Adventures of Demo ======================================= | |
# The side game about Demo and siblings from the A2XT universe by raocow and his fan community. | |
- { | |
name: "Adventures of Demo", | |
os: ubuntu-20.04, | |
extra_options: "-DTHEXTECH_EXECUTABLE_NAME=advdemo \ | |
-DTHEXTECH_GAME_NAME_TITLE=\"Adventures of Demo - Web Edition\" \ | |
-DTHEXTECH_CREDITS_URL=\"wohlsoft.ru\" \ | |
-DTHEXTECH_CREDITS_TITLE=\"Adventures of Demo\" \ | |
-DTHEXTECH_MANIFEST_NAME=\"AoD on TheXTech ${THEXTECH_VERSION_STRING}\" \ | |
-DTHEXTECH_MANIFEST_ID=\"wohlsoft-aod-thextech\" \ | |
-DTHEXTECH_MANIFEST_DESC=\"Play AoD on TheXTech ${THEXTECH_VERSION_STRING}\" \ | |
-DTHEXTECH_DEPLOY_URL=\"https://wohlsoft.ru/projects/TheXTech/aod-on-web-debug/\"", | |
deps_cmdline: "sudo apt-get update -qq \ | |
&& sudo apt-get install -qq cmake ninja-build cmake ninja-build lftp", | |
generator: "Ninja", | |
build_type: "MinSizeRel", | |
executable_name: "advdemo", | |
assets_url: "https://wohlsoft.ru/projects/TheXTech/_downloads/thextech-adventure-of-demo-assets-full.7z", | |
subdir_name: "thextech-adventures-of-demo", | |
package_filename_game: "adventures-of-demo", | |
upload_directory: "www/webassembly/" | |
} | |
# ======================================= Super Mario Bros. X - a fan-game ======================================= | |
# Was made in 2009 by Andrew Spinks "Redigit", and supported up to 2011 by it's original author. | |
- { | |
name: "Super Mario Bros. X", | |
os: ubuntu-20.04, | |
extra_options: "-DTHEXTECH_EXECUTABLE_NAME=smbx \ | |
-DTHEXTECH_GAME_NAME_TITLE=\"Super Mario Bros. X - Web Edition\" \ | |
-DTHEXTECH_CREDITS_URL=\"www.SuperMarioBrosX.org\" \ | |
-DTHEXTECH_CREDITS_TITLE=\"Super Mario Bros. X\" \ | |
-DTHEXTECH_MANIFEST_NAME=\"SMBX on TheXTech ${THEXTECH_VERSION_STRING}\" \ | |
-DTHEXTECH_MANIFEST_ID=\"wohlsoft-smbx-thextech\" \ | |
-DTHEXTECH_MANIFEST_DESC=\"Play SMBX on TheXTech ${THEXTECH_VERSION_STRING}\" \ | |
-DTHEXTECH_DEPLOY_URL=\"https://wohlsoft.ru/projects/TheXTech/smbx-on-web-debug/\"", | |
deps_cmdline: "sudo apt-get update -qq \ | |
&& sudo apt-get install -qq cmake ninja-build cmake ninja-build lftp", | |
generator: "Ninja", | |
build_type: "MinSizeRel", | |
executable_name: "smbx", | |
assets_url: "https://wohlsoft.ru/projects/TheXTech/_downloads/thextech-smbx13-assets-full.7z", | |
subdir_name: "thextech-super-mario-bros-x", | |
package_filename_game: "super-mario-bros-x", | |
upload_directory: "www/webassembly/" | |
} | |
steps: | |
- name: Check for the upload support | |
id: upload-check | |
shell: bash | |
run: | | |
if [[ "${{ secrets.builds_login }}" != '' && \ | |
"${{ secrets.builds_password }}" != '' && \ | |
"${{ secrets.builds_host }}" != '' ]]; then | |
echo "available=true" >> $GITHUB_OUTPUT; | |
else | |
echo "available=false" >> $GITHUB_OUTPUT; | |
fi | |
- uses: styfle/cancel-workflow-action@0.11.0 | |
with: | |
workflow_id: emscripten-ci.yml | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
if [[ ! -z "${{ matrix.config.deps_cmdline }}" ]]; then | |
eval ${{ matrix.config.deps_cmdline }} | |
fi | |
cmake --version | |
- uses: actions/checkout@v3 | |
# - uses: nelonoel/branch-name@v1.0.1 | |
- uses: Wohlstand/branch-name@v1.0.1-wohl | |
- name: Check if a pull request | |
id: event-check | |
shell: bash | |
run: | | |
if [[ "${BRANCH_NAME}" == *"merge"* ]]; then | |
echo "--- This build is a pull-request ---" | |
echo "is_pull_request=true" >> $GITHUB_OUTPUT; | |
else | |
echo "--- This build is a normal branch build ---" | |
echo "is_pull_request=false" >> $GITHUB_OUTPUT; | |
fi | |
- name: Pull submodules | |
shell: bash | |
run: | | |
# Pull submodules | |
git submodule init | |
git submodule update | |
- name: Install emscripten | |
run: | | |
cd .. | |
git clone https://github.com/emscripten-core/emsdk.git | |
cd emsdk | |
./emsdk install latest | |
./emsdk activate latest | |
- name: Download assets | |
uses: carlosperate/download-file-action@v2 | |
with: | |
file-url: "${{ matrix.config.assets_url }}" | |
file-name: assets.7z | |
- name: Unpack assets | |
shell: bash | |
run: | | |
mkdir -p assets | |
cd assets | |
7z x ../assets.7z | |
cd .. | |
rm assets.7z | |
- name: Apply update to translations | |
shell: bash | |
run: | | |
ASSETS_ROOT="$PWD/assets" | |
cd .github/ci-helper | |
bash translate_update.sh "${ASSETS_ROOT}" | |
cd ../.. | |
- name: Configure | |
shell: bash | |
run: | | |
source ../emsdk/emsdk_env.sh | |
emcmake cmake -B build -G "${{ matrix.config.generator }}" \ | |
-DENABLE_LOGGING=OFF -DENABLE_ANTICHEAT_TRAP=ON \ | |
-DPGE_PRELOAD_ENVIRONMENT="`pwd`/assets" \ | |
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} ${{ matrix.config.extra_options }} . | |
- name: Build | |
shell: bash | |
run: | | |
source ../emsdk/emsdk_env.sh | |
emmake cmake --build build --target all | |
- name: Create Package | |
if: success() | |
shell: bash | |
run: | | |
if [[ "${BRANCH_NAME}" == *"merge"* ]]; then | |
BRANCH_NAME_RES="pull-request" | |
echo "-- Pull-request detected!" | |
else | |
BRANCH_NAME_RES=${BRANCH_NAME} | |
fi | |
cd build | |
mkdir package | |
mkdir "package/${{ matrix.config.subdir_name }}" | |
cp ../changelog.txt "package/${{ matrix.config.subdir_name }}/" | |
cp ../LICENSE "package/${{ matrix.config.subdir_name }}/License.TheXTech.txt" | |
cp ../README.md "package/${{ matrix.config.subdir_name }}/" | |
cp ../README.RUS.md "package/${{ matrix.config.subdir_name }}/" | |
cp ../README.ESP.md "package/${{ matrix.config.subdir_name }}/" | |
cp output/bin/* "package/${{ matrix.config.subdir_name }}/" | |
cd package | |
tar -cvzf "thextech-${{ matrix.config.package_filename_game }}-webassembly-${BRANCH_NAME_RES}.tar.gz" "${{ matrix.config.subdir_name }}" | |
rm -Rf "${{ matrix.config.subdir_name }}" | |
cd ../.. | |
- name: Upload artifact | |
if: success() | |
uses: actions/upload-artifact@v3 | |
continue-on-error: true | |
with: | |
path: build/package/*.tar.gz | |
name: ${{ matrix.config.name }} ${{ matrix.config.build_type }} | |
- name: Deploy to builds.wohlsoft.ru | |
if: success() && github.event_name != 'pull_request' && steps.event-check.outputs.is_pull_request == 'false' && steps.upload-check.outputs.available == 'true' | |
continue-on-error: true | |
shell: bash | |
run: | | |
if [[ ! -z "${{ matrix.config.extra_path }}" ]]; then | |
export PATH=${{ matrix.config.extra_path }}:${PATH} | |
fi | |
UPLOAD_LIST="set ssl:verify-certificate no;" | |
for q in ./build/package/*.tar.gz; do | |
UPLOAD_LIST="${UPLOAD_LIST} put -O ${{ matrix.config.upload_directory }} $q;" | |
done | |
lftp -e "${UPLOAD_LIST} exit" -u ${{ secrets.builds_login }},${{ secrets.builds_password }} ${{ secrets.builds_host }} | |
- name: List Build Directory | |
if: always() | |
shell: bash | |
run: | | |
git status | |
ls -lR build |