137 lines
4.1 KiB
YAML
Raw Normal View History

2024-02-04 00:36:58 -05:00
name: 'CI'
2023-09-20 20:54:07 -04:00
on:
push:
branches:
- master
tags:
- '*'
2023-11-24 03:07:06 -05:00
- '!flatpak'
2023-06-03 23:48:28 -04:00
2024-11-23 00:01:27 -05:00
# Jobs
2023-06-03 23:48:28 -04:00
jobs:
2023-11-24 18:37:08 -05:00
# Build Project
2023-09-20 20:54:07 -04:00
build:
2023-11-24 18:37:08 -05:00
strategy:
fail-fast: false
matrix:
arch:
- AMD64
- ARM64
- ARMHF
2024-06-14 03:26:23 -04:00
name: Build
2023-09-20 20:54:07 -04:00
runs-on: ubuntu-latest
2024-01-23 18:20:14 -05:00
container: node:lts-bullseye
2023-09-20 20:54:07 -04:00
steps:
- name: Checkout Repository
2023-11-24 18:37:08 -05:00
uses: actions/checkout@v4
2023-09-20 20:54:07 -04:00
with:
submodules: true
2023-11-24 18:37:08 -05:00
# Dependencies
2023-09-20 20:54:07 -04:00
- name: Install Dependencies
2024-06-15 08:52:15 -04:00
run: ./scripts/install-dependencies.sh build ${{ matrix.arch }}
2023-11-24 18:37:08 -05:00
# Build
2023-09-20 20:54:07 -04:00
- name: Build
2024-06-15 08:52:15 -04:00
run: ./scripts/build.mjs appimage ${{ matrix.arch }}
2023-09-20 20:54:07 -04:00
- name: Upload Artifacts
2024-11-23 00:01:27 -05:00
uses: actions/upload-artifact@v3
2023-09-20 20:54:07 -04:00
with:
2024-06-15 08:52:15 -04:00
name: ${{ matrix.arch }}
2024-02-04 00:36:58 -05:00
path: ./out/*.AppImage*
if-no-files-found: error
2023-11-24 18:37:08 -05:00
# Test Project
test:
2024-06-15 08:52:15 -04:00
needs: build
2024-06-14 03:22:01 -04:00
strategy:
fail-fast: false
matrix:
mode:
- Client
- Server
arch:
2024-06-15 08:52:15 -04:00
- AMD64
2024-06-14 03:22:01 -04:00
- ARM64
- ARMHF
2024-06-15 08:52:15 -04:00
name: Test
runs-on: ${{ startsWith(matrix.arch, 'ARM') && 'raspberry-pi' || 'ubuntu-latest' }}
2024-06-14 03:22:01 -04:00
container: node:lts-bullseye
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
2024-06-15 10:19:18 -04:00
submodules: false
2024-06-14 03:22:01 -04:00
# Dependencies
- name: Install Dependencies
2024-06-15 08:52:15 -04:00
run: ./scripts/install-dependencies.sh test ${{ matrix.arch }}
# Download Artifact
- name: Download Artifact
2024-11-23 08:03:10 -05:00
uses: actions/download-artifact@v3
2024-06-15 08:52:15 -04:00
with:
name: ${{ matrix.arch }}
path: out
2024-06-14 03:22:01 -04:00
# Test
- name: Test
2024-06-15 08:52:15 -04:00
run: ./scripts/test.sh ${{ matrix.mode }} ${{ matrix.arch }}
2024-02-04 00:36:58 -05:00
# Example Mods
example-mods:
2024-06-15 08:52:15 -04:00
needs: build
2024-02-04 00:36:58 -05:00
name: Build Example Mods
runs-on: ubuntu-latest
container: node:lts-bullseye
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
2024-06-15 10:19:18 -04:00
submodules: false
2024-02-04 00:36:58 -05:00
# Dependencies
- name: Install Dependencies
2024-06-15 08:52:15 -04:00
run: ./scripts/install-dependencies.sh example_mods amd64
# SDK
- name: Download SDK
2024-11-23 00:01:27 -05:00
uses: actions/download-artifact@v3
2024-06-15 08:52:15 -04:00
with:
name: AMD64
path: out
- name: Extract SDK
2024-02-04 00:36:58 -05:00
run: |
2024-06-15 08:52:15 -04:00
./scripts/fix-appimage-for-docker.sh ./out/*.AppImage
chmod +x ./out/*.AppImage
2024-06-15 10:19:18 -04:00
./out/*.AppImage --appimage-extract-and-run --copy-sdk
2024-02-04 00:36:58 -05:00
# Build Example Mods
- name: Build Example Mods
2024-02-12 00:44:38 -05:00
run: ./example-mods/build.sh
2024-02-04 00:36:58 -05:00
- name: Upload Artifacts
2024-11-23 00:01:27 -05:00
uses: actions/upload-artifact@v3
2024-02-04 00:36:58 -05:00
with:
name: Example Mods
2024-02-04 00:43:25 -05:00
path: ./example-mods/out/*
2024-02-04 00:36:58 -05:00
if-no-files-found: error
2023-11-24 18:37:08 -05:00
# Create Release
release:
if: startsWith(github.ref, 'refs/tags/')
2024-06-15 08:52:15 -04:00
needs:
- build
- test
- example-mods
2023-11-24 18:37:08 -05:00
name: Release
runs-on: ubuntu-latest
2024-01-23 21:57:57 -05:00
container: node:lts-bullseye
2023-11-24 18:37:08 -05:00
steps:
# Dependencies
- name: Install Go
2024-05-30 21:52:15 -04:00
uses: actions/setup-go@v5
2023-11-24 18:37:08 -05:00
with:
go-version: '>=1.20.1'
# Download Artifacts
2023-11-25 02:39:19 -05:00
- name: Download Artifacts
2024-11-23 00:01:27 -05:00
uses: actions/download-artifact@v3
2023-11-24 18:37:08 -05:00
with:
path: out
# Create Release
2023-09-20 20:54:07 -04:00
- name: Create Release
uses: https://gitea.com/actions/release-action@main
with:
2024-02-04 00:36:58 -05:00
files: ./out/*/*.AppImage*
2023-09-20 20:54:07 -04:00
api_key: ${{ secrets.RELEASE_TOKEN }}
2023-09-21 12:55:40 -04:00
title: v${{ github.ref_name }}
2024-11-23 00:01:27 -05:00
body: '[View Changelog](https://gitea.thebrokenrail.com/minecraft-pi-reborn/minecraft-pi-reborn/src/branch/master/docs/CHANGELOG.md)'