minecraft-pi-reborn/.gitea/workflows/build.yml

123 lines
3.8 KiB
YAML
Raw Normal View History

2024-02-04 05:36:58 +00:00
name: 'CI'
2023-06-04 03:48:28 +00:00
2023-09-21 00:54:07 +00:00
on:
push:
branches:
- master
tags:
- '*'
2023-11-24 08:07:06 +00:00
- '!flatpak'
2023-06-04 03:48:28 +00:00
jobs:
2023-11-24 23:37:08 +00:00
# Build Project
2023-09-21 00:54:07 +00:00
build:
2023-11-24 23:37:08 +00:00
strategy:
fail-fast: false
matrix:
mode:
- Client
- Server
arch:
- AMD64
- ARM64
- ARMHF
2023-11-24 23:53:16 +00:00
name: Build
2023-09-21 00:54:07 +00:00
runs-on: ubuntu-latest
2024-01-23 23:20:14 +00:00
container: node:lts-bullseye
2023-09-21 00:54:07 +00:00
steps:
- name: Checkout Repository
2023-11-24 23:37:08 +00:00
uses: actions/checkout@v4
2023-09-21 00:54:07 +00:00
with:
submodules: true
2023-11-24 23:37:08 +00:00
# Dependencies
2023-09-21 00:54:07 +00:00
- name: Install Dependencies
2023-11-24 23:37:08 +00:00
run: ./scripts/install-dependencies.sh ${{ matrix.arch }}
# Build
2023-09-21 00:54:07 +00:00
- name: Build
2024-02-04 02:07:53 +00:00
run: ./scripts/build.mjs appimage ${{ matrix.mode }} ${{ matrix.arch }}
2023-09-21 00:54:07 +00:00
- name: Upload Artifacts
2024-05-31 01:52:15 +00:00
uses: actions/upload-artifact@v4
2023-09-21 00:54:07 +00:00
with:
2024-02-04 05:36:58 +00:00
name: ${{ matrix.mode }} (${{ matrix.arch }})
path: ./out/*.AppImage*
if-no-files-found: error
2023-11-24 23:37:08 +00:00
# Test Project
test:
2023-12-26 22:29:45 +00:00
strategy:
fail-fast: false
matrix:
mode:
- Client
- Server
2023-11-24 23:37:08 +00:00
name: Test
runs-on: ubuntu-latest
2024-01-24 02:57:57 +00:00
container: node:lts-bullseye
2023-11-24 23:37:08 +00:00
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
# Dependencies
- name: Install Dependencies
run: ./scripts/install-dependencies.sh
# Test
- name: Test
2023-12-26 22:29:45 +00:00
run: ./scripts/test.sh ${{ matrix.mode }}
2024-02-04 05:36:58 +00:00
# Example Mods
example-mods:
name: Build Example Mods
runs-on: ubuntu-latest
container: node:lts-bullseye
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
# Dependencies
- name: Install Dependencies
run: ./scripts/install-dependencies.sh
- name: Install ARM Toolchain
run: apt-get install --no-install-recommends -y g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf
# Build SDK
- name: Build SDK
run: |
./scripts/build.mjs none client host
2024-02-04 06:31:41 +00:00
export _MCPI_SKIP_ROOT_CHECK=1
2024-02-04 07:33:35 +00:00
export DISPLAY=
2024-02-04 05:36:58 +00:00
./out/client/host/usr/bin/minecraft-pi-reborn-client --copy-sdk
# Build Example Mods
- name: Build Example Mods
2024-02-12 05:44:38 +00:00
run: ./example-mods/build.sh
2024-02-04 05:36:58 +00:00
- name: Upload Artifacts
2024-05-31 01:52:15 +00:00
uses: actions/upload-artifact@v4
2024-02-04 05:36:58 +00:00
with:
name: Example Mods
2024-02-04 05:43:25 +00:00
path: ./example-mods/out/*
2024-02-04 05:36:58 +00:00
if-no-files-found: error
2023-11-24 23:37:08 +00:00
# Create Release
release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
name: Release
runs-on: ubuntu-latest
2024-01-24 02:57:57 +00:00
container: node:lts-bullseye
2023-11-24 23:37:08 +00:00
steps:
# Dependencies
- name: Install Go
2024-05-31 01:52:15 +00:00
uses: actions/setup-go@v5
2023-11-24 23:37:08 +00:00
with:
go-version: '>=1.20.1'
# Download Artifacts
2023-11-25 07:39:19 +00:00
- name: Download Artifacts
2024-05-31 01:52:15 +00:00
uses: actions/download-artifact@v4
2023-11-24 23:37:08 +00:00
with:
path: out
# Create Release
2023-09-21 00:54:07 +00:00
- name: Create Release
uses: https://gitea.com/actions/release-action@main
with:
2024-02-04 05:36:58 +00:00
files: ./out/*/*.AppImage*
2023-09-21 00:54:07 +00:00
api_key: ${{ secrets.RELEASE_TOKEN }}
2023-09-21 16:55:40 +00:00
title: v${{ github.ref_name }}
body: "[View Changelog](https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/src/branch/master/docs/CHANGELOG.md)"