mirror of
https://github.com/pret/pmd-sky.git
synced 2026-03-21 17:25:15 -05:00
103 lines
3.6 KiB
YAML
103 lines
3.6 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
LM_LICENSE_FILE: "$GITHUB_WORKSPACE/tools/mwccarm/license.dat"
|
|
CC: gcc-10
|
|
CXX: g++-10
|
|
CALCROM_DISCORD_WEBHOOK_AVATAR_URL: "https://i.imgur.com/38BQHdd.png"
|
|
CALCROM_DISCORD_WEBHOOK_USERNAME: OK
|
|
CALCROM_WEBHOOK_URL: ${{ secrets.WEBHOOKURL }}
|
|
COMPARE: 1
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- name: Update and install software
|
|
run: |
|
|
sudo apt update
|
|
sudo ACCEPT_EULA=Y apt -y --fix-missing --allow-downgrades upgrade
|
|
sudo apt -y --allow-downgrades install g++-10-multilib linux-libc-dev binutils-arm-none-eabi p7zip-full pkg-config libpugixml-dev ppa-purge
|
|
sudo ppa-purge -y ppa:ubuntu-toolchain-r/test
|
|
sudo dpkg --add-architecture i386
|
|
sudo mkdir -pm755 /etc/apt/keyrings
|
|
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
|
|
sudo add-apt-repository ppa:cybermax-dexter/sdl2-backport
|
|
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/$(lsb_release -cs)/winehq-$(lsb_release -cs).sources
|
|
sudo apt update
|
|
sudo apt -y --allow-downgrades install --install-recommends winehq-stable
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up repo
|
|
run: |
|
|
mkdir -p ~/download
|
|
cd ~/download
|
|
wget https://cdn.discordapp.com/attachments/698589325620936736/845499146982129684/mwccarm.zip
|
|
wget https://cdn.discordapp.com/attachments/855279572651868170/875195363261292604/NitroSDK-4_2-071210-jp.7z
|
|
unzip mwccarm.zip
|
|
mv mwccarm $GITHUB_WORKSPACE/tools
|
|
7z x NitroSDK-4_2-071210-jp.7z
|
|
mv NitroSDK-4_2-071210-jp/tools/bin $GITHUB_WORKSPACE/tools
|
|
mv NitroSDK-4_2-071210-jp/include/nitro/specfiles/ARM7-TS.lcf.template $GITHUB_WORKSPACE/sub/
|
|
mv NitroSDK-4_2-071210-jp/include/nitro/specfiles/ARM9-TS.lcf.template $GITHUB_WORKSPACE/
|
|
mv NitroSDK-4_2-071210-jp/include/nitro/specfiles/mwldarm.response.template $GITHUB_WORKSPACE/
|
|
working-directory: ~
|
|
|
|
- name: Build
|
|
env:
|
|
GAME_LANGUAGE: ENGLISH
|
|
GAME_REVISION: 0
|
|
run: make -j${nproc}
|
|
|
|
- name: Webhook
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: |
|
|
sudo chmod 755 $GITHUB_WORKSPACE/.github/calcrom/webhook.sh
|
|
$GITHUB_WORKSPACE/.github/calcrom/webhook.sh pmdsky "$CALCROM_WEBHOOK_URL"
|
|
continue-on-error: true
|
|
|
|
- name: Post error archive
|
|
if: failure()
|
|
continue-on-error: true
|
|
run: find . -maxdepth 2 -type d \( -name build -or -name files \) -exec tar -czvhf failure.tar.gz {} +
|
|
|
|
- name: Post error upload
|
|
if: failure()
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: pmdsky-failure-${{ github.run_id }}
|
|
path: failure.tar.gz
|
|
retention-days: 1
|
|
|
|
- name: Checkout xMAP
|
|
if: ${{ github.event_name == 'push' }}
|
|
uses: actions/checkout@main
|
|
with:
|
|
path: 'xmap'
|
|
ref: 'xmap'
|
|
|
|
- name: Move xMAP
|
|
if: ${{ github.event_name == 'push' }}
|
|
run: |
|
|
mkdir -p xmap
|
|
cp build/pmdsky.us/*.xMAP xmap/pmdskyus.xMAP
|
|
echo "XMAP_COMMIT_MSG=$( git log --format=%s ${GITHUB_SHA} )" >> $GITHUB_ENV
|
|
|
|
- name: Update xMAP
|
|
if: ${{ github.event_name == 'push' }}
|
|
uses: EndBug/add-and-commit@v7
|
|
with:
|
|
branch: xmap
|
|
cwd: "./xmap"
|
|
add: "*.xMAP"
|
|
message: ${{ env.XMAP_COMMIT_MSG }}
|