Skip to content

[tools] TTF/OTF support in asset sources and assets transformation an… #161

[tools] TTF/OTF support in asset sources and assets transformation an…

[tools] TTF/OTF support in asset sources and assets transformation an… #161

Workflow file for this run

name: Build ceramic
on:
push:
branches:
- '**'
tags:
- v**
jobs:
build-ceramic-windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Haxe
working-directory: .
run: |
$NEKOPATH = $(Convert-Path .)+'/git/haxe-binary/windows/neko'
$HAXEPATH = $(Convert-Path .)+'/git/haxe-binary/windows/haxe'
echo $NEKOPATH >> $GITHUB_PATH
echo $HAXEPATH >> $GITHUB_PATH
echo $NEKOPATH
echo $HAXEPATH
- name: Build ceramic
working-directory: .
run: |
cd tools
node ./install
cd ../runner
npm ci
cd ..
- name: Cleanup
working-directory: .
run: |
Remove-Item 'git/haxe-binary/linux-x86_64' -Recurse
Remove-Item 'git/haxe-binary/linux-arm64' -Recurse
Remove-Item 'git/haxe-binary/mac' -Recurse
cd tools
Remove-Item './haxe'
Remove-Item './haxelib'
Remove-Item './neko'
cd ..
- name: Run ceramic
working-directory: ./tools
run: |
./ceramic
- name: Check ceramic version
if: startsWith(github.ref, 'refs/tags/')
working-directory: ./tools
run: |
$GIT_TAG = $($env:GITHUB_REF).replace("refs/tags/", "")
./ceramic version --check-tag $GIT_TAG
- name: Create zip archive
working-directory: .
run: |
$ZIP_COMPRESS = $(Convert-Path .)
$ZIP_EXCLUDE = @(".git", ".github", "ceramic-windows.zip")
$ZIP_DESTINATION = 'ceramic-windows.zip'
$ZIP_FILES = Get-ChildItem -Path $ZIP_COMPRESS -Exclude $ZIP_EXCLUDE
Compress-Archive -Path $ZIP_FILES -DestinationPath $ZIP_DESTINATION -CompressionLevel Optimal
- name: Upload Files
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ceramic-windows.zip
path: ceramic-windows.zip
compression-level: 0
build-ceramic-mac:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Haxe
working-directory: .
run: |
set -ex
export NEKOPATH=$PWD'/git/haxe-binary/mac/neko'
export HAXEPATH=$PWD'/git/haxe-binary/mac/haxe'
echo 'neko path: '$NEKOPATH
echo 'haxe path: '$HAXEPATH
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/share/haxe
sudo ln -s $HAXEPATH/haxe /usr/local/bin/haxe
sudo ln -s $HAXEPATH/haxelib /usr/local/bin/haxelib
sudo ln -s $HAXEPATH/haxe-bin /usr/local/bin/haxe-bin
sudo ln -s $HAXEPATH/haxelib-bin /usr/local/bin/haxelib-bin
sudo ln -s $HAXEPATH/std /usr/local/share/haxe/std
sudo ln -s $NEKOPATH/neko /usr/local/bin/neko
sudo ln -s $NEKOPATH/nekoc /usr/local/bin/nekoc
sudo ln -s $NEKOPATH/nekoml /usr/local/bin/nekoml
sudo ln -s $NEKOPATH/nekotools /usr/local/bin/nekotools
sudo ln -s $NEKOPATH /usr/local/lib/neko
sudo ln -s $NEKOPATH/libneko.dylib /usr/local/lib/libneko.dylib
sudo ln -s $NEKOPATH/libneko.2.4.0.dylib /usr/local/lib/libneko.2.4.0.dylib
sudo ln -s $NEKOPATH/libneko.2.dylib /usr/local/lib/libneko.2.dylib
set +x
echo 'neko: '$(neko -version)
echo 'haxe: '$(haxe --version)
- name: Build ceramic
working-directory: .
run: |
cd tools
node ./install
cd ../runner
npm ci
cd ..
- name: Cleanup
working-directory: .
run: |
rm -rf git/haxe-binary/linux-x86_64
rm -rf git/haxe-binary/linux-arm64
rm -rf git/haxe-binary/windows
cd tools
rm -f ./haxe.cmd
rm -f ./neko.cmd
rm -f ./ceramic.cmd
cd ..
- name: Run ceramic
working-directory: ./tools
run: |
./ceramic
- name: Check ceramic version
if: startsWith(github.ref, 'refs/tags/')
working-directory: ./tools
run: |
GIT_TAG=${GITHUB_REF/refs\/tags\//}
./ceramic version --check-tag $GIT_TAG
- name: Create zip archive
run: zip --symlinks -9 -r 'ceramic-mac.zip' . -x ".git/*" ".github/*"
- name: Upload Files
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ceramic-mac.zip
path: ceramic-mac.zip
compression-level: 0
build-ceramic-linux-x86_64:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Setup Haxe
working-directory: .
run: |
export NEKOPATH=$PWD'/git/haxe-binary/linux-x86_64/neko'
export HAXEPATH=$PWD'/git/haxe-binary/linux-x86_64/haxe'
echo 'neko path: '$NEKOPATH
echo 'haxe path: '$HAXEPATH
sudo mkdir -p /usr/local/bin
sudo mkdir -p /usr/local/lib
sudo mkdir -p /usr/local/share/haxe
sudo ln -s $HAXEPATH/haxe /usr/local/bin/haxe
sudo ln -s $HAXEPATH/haxelib /usr/local/bin/haxelib
sudo ln -s $HAXEPATH/haxe-bin /usr/local/bin/haxe-bin
sudo ln -s $HAXEPATH/haxelib-bin /usr/local/bin/haxelib-bin
sudo ln -s $HAXEPATH/std /usr/local/share/haxe/std
sudo ln -s $NEKOPATH/neko /usr/local/bin/neko
sudo ln -s $NEKOPATH/nekoc /usr/local/bin/nekoc
sudo ln -s $NEKOPATH/nekoml /usr/local/bin/nekoml
sudo ln -s $NEKOPATH/nekotools /usr/local/bin/nekotools
sudo ln -s $NEKOPATH /usr/local/lib/neko
sudo ln -s $NEKOPATH/libneko.so /usr/local/lib/libneko.so
sudo ln -s $NEKOPATH/libneko.so.2.4.0 /usr/local/lib/libneko.so.2.4.0
sudo ln -s $NEKOPATH/libneko.so.2 /usr/local/lib/libneko.so.2
sudo ldconfig
sudo ldconfig /usr/local/lib
echo 'neko: '$(neko -version)
echo 'haxe: '$(haxe --version)
- name: Build ceramic
working-directory: .
run: |
cd tools
node ./install
cd ../runner
npm ci
cd ..
- name: Cleanup
working-directory: .
run: |
rm -rf git/haxe-binary/mac
rm -rf git/haxe-binary/linux-arm64
rm -rf git/haxe-binary/windows
cd tools
rm -f ./haxe.cmd
rm -f ./neko.cmd
rm -f ./ceramic.cmd
cd ..
- name: Run ceramic
working-directory: ./tools
run: |
./ceramic
- name: Check ceramic version
if: startsWith(github.ref, 'refs/tags/')
working-directory: ./tools
run: |
GIT_TAG=${GITHUB_REF/refs\/tags\//}
./ceramic version --check-tag $GIT_TAG
- name: Create zip archive
run: zip --symlinks -9 -r 'ceramic-linux-x86_64.zip' . -x ".git/*" ".github/*"
- name: Upload Files
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ceramic-linux-x86_64.zip
path: ceramic-linux-x86_64.zip
compression-level: 0
build-ceramic-linux-arm64:
runs-on: ubuntu-22.04
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Create Dockerfile
run: |
cat > Dockerfile << 'EOL'
FROM --platform=$TARGETPLATFORM ubuntu:22.04
ARG NODE_VERSION
# Install dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
zip \
sudo \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Setup Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& apt-get install -y nodejs
# Copy repository contents
COPY . /ceramic
WORKDIR /ceramic
# Setup Haxe
ENV NEKOPATH=/ceramic/git/haxe-binary/linux-arm64/neko \
HAXEPATH=/ceramic/git/haxe-binary/linux-arm64/haxe
RUN mkdir -p /usr/local/bin /usr/local/lib /usr/local/share/haxe \
&& ln -s $HAXEPATH/haxe /usr/local/bin/haxe \
&& ln -s $HAXEPATH/haxelib /usr/local/bin/haxelib \
&& ln -s $HAXEPATH/haxe-bin /usr/local/bin/haxe-bin \
&& ln -s $HAXEPATH/haxelib-bin /usr/local/bin/haxelib-bin \
&& ln -s $HAXEPATH/std /usr/local/share/haxe/std \
&& ln -s $NEKOPATH/neko /usr/local/bin/neko \
&& ln -s $NEKOPATH/nekoc /usr/local/bin/nekoc \
&& ln -s $NEKOPATH/nekoml /usr/local/bin/nekoml \
&& ln -s $NEKOPATH/nekotools /usr/local/bin/nekotools \
&& ln -s $NEKOPATH /usr/local/lib/neko \
&& ln -s $NEKOPATH/libneko.so /usr/local/lib/libneko.so \
&& ln -s $NEKOPATH/libneko.so.2.4.0 /usr/local/lib/libneko.so.2.4.0 \
&& ln -s $NEKOPATH/libneko.so.2 /usr/local/lib/libneko.so.2 \
&& ldconfig \
&& ldconfig /usr/local/lib
# Build ceramic
RUN cd tools \
&& node ./install \
&& cd ../runner \
&& npm ci \
&& cd ..
# Cleanup
RUN rm -rf git/haxe-binary/mac \
&& rm -rf git/haxe-binary/linux-x86_64 \
&& rm -rf git/haxe-binary/windows \
&& cd tools \
&& rm -f ./haxe.cmd \
&& rm -f ./neko.cmd \
&& rm -f ./ceramic.cmd
# Run ceramic
RUN cd tools && ./ceramic
# Create artifact
RUN zip --symlinks -9 -r 'ceramic-linux-arm64.zip' . -x ".git/*" ".github/*"
EOL
- name: Build in ARM64 container
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
load: true
tags: ceramic-builder:latest
build-args: |
NODE_VERSION=22
file: ./Dockerfile
- name: Copy artifact from container
run: |
docker cp $(docker create ceramic-builder:latest):/ceramic/ceramic-linux-arm64.zip .
- name: Upload Files
uses: actions/upload-artifact@v4
with:
retention-days: 1
name: ceramic-linux-arm64.zip
path: ceramic-linux-arm64.zip
compression-level: 0
create-release:
if: startsWith(github.ref, 'refs/tags/')
needs: [build-ceramic-windows, build-ceramic-mac, build-ceramic-linux-x86_64, build-ceramic-linux-arm64]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Download ceramic-windows.zip
uses: actions/download-artifact@v4
with:
name: ceramic-windows.zip
path: .
- name: Download ceramic-mac.zip
uses: actions/download-artifact@v4
with:
name: ceramic-mac.zip
path: .
- name: Download ceramic-linux-x86_64.zip
uses: actions/download-artifact@v4
with:
name: ceramic-linux-x86_64.zip
path: .
- name: Download ceramic-linux-arm64.zip
uses: actions/download-artifact@v4
with:
name: ceramic-linux-arm64.zip
path: .
- name: Extract tag name
id: extract_tag
run: echo "TAG_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: Ceramic ${{ env.TAG_NAME }}
body: |
Ceramic ${{ env.TAG_NAME }}
draft: false
prerelease: false
files: |
ceramic-windows.zip
ceramic-mac.zip
ceramic-linux-x86_64.zip
ceramic-linux-arm64.zip
generate-api-docs:
if: startsWith(github.ref, 'refs/tags/')
needs: [create-release]
runs-on: ubuntu-22.04
steps:
- name: Dispatch event
uses: ceramic-engine/repository-dispatch@v1
with:
token: ${{ secrets.PAT_PUBLIC }}
repository: ceramic-engine/api-docs
event-type: deploy-api-docs
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'