Skip to content

Commit

Permalink
Fixed vs/vts templating. Updating docs & workflows. Added flag to con…
Browse files Browse the repository at this point in the history
…trol x11 usage.
  • Loading branch information
karurochari committed Dec 7, 2024
1 parent e53443a commit 70c58b7
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 161 deletions.
180 changes: 90 additions & 90 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ concurrency:

on:
push:
branches: [ master ]
branches: [master]
paths:
- '**'
- '!**.yml'
- '!docs/**'
- '!docker/**'
- '!**.md'
- '**/build.yml'
- "**"
- "!**.yml"
- "!docs/**"
- "!docker/**"
- "!**.md"
- "**/build.yml"
pull_request:
branches: [ master ]
branches: [master]
paths:
- '**'
- '!**.yml'
- '!docs/**'
- '!docker/**'
- '!**.md'
- '**/build.yml'
- "**"
- "!**.yml"
- "!docs/**"
- "!docker/**"
- "!**.md"
- "**/build.yml"

jobs:
meson:
Expand All @@ -35,86 +35,86 @@ jobs:
CC: clang-19
CXX: clang++-19
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
if [ "${{ contains(matrix.os, 'ubuntu') }}" = "true" ]; then
sudo apt update
curl -fsSL https://bun.sh/install | bash
echo "PATH=$HOME/.bun/bin:$PATH" >> $GITHUB_ENV
sudo apt update
sudo apt remove -y firefox
sudo apt upgrade -y
sudo apt install -y \
freeglut3-dev \
libcurl4-openssl-dev \
libpng-dev \
libsqlite3-0 \
python3-pip \
python3-setuptools
python3 -m pip install meson ninja
python3 -m pip uninstall cmake
python3 -m pip install cmake==3.30.5 # workaround https://github.com/mesonbuild/meson/issues/13888
# for clang
sudo apt install -y wget gpg gnupg software-properties-common
curl -LO https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19 # install clang-19
else
brew update
brew install meson ninja
fi
- uses: actions/checkout@v4
- name: Install dependencies
run: |
if [ "${{ contains(matrix.os, 'ubuntu') }}" = "true" ]; then
sudo apt update
curl -fsSL https://bun.sh/install | bash
echo "PATH=$HOME/.bun/bin:$PATH" >> $GITHUB_ENV
sudo apt update
sudo apt remove -y firefox
sudo apt upgrade -y
sudo apt install -y \
freeglut3-dev \
libcurl4-openssl-dev \
libpng-dev \
libsqlite3-0 \
python3-pip \
python3-setuptools
python3 -m pip install meson ninja
python3 -m pip uninstall cmake
python3 -m pip install cmake==3.30.5 # workaround https://github.com/mesonbuild/meson/issues/13888
# for clang
sudo apt install -y wget gpg gnupg software-properties-common
curl -LO https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 19 # install clang-19
else
brew update
brew install meson ninja
fi
- name: Configure and build
run: |
cmake --version
bun install
bun run codegen
bun run meson-setup.clang-release
meson compile -C build/ vs:executable
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: ubuntu-meson-logs
path: |
build/meson-logs/**/*
- name: Configure and build
run: |
cmake --version
bun install
bun run codegen
bun run meson-setup.clang-release
meson compile -C build/ vs:executable
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: ubuntu-meson-logs
path: |
build/meson-logs/**/*
macos:
runs-on: macos-14
timeout-minutes: 8
env:
LDFLAGS: '-L/opt/homebrew/opt/llvm/lib'
CPPFLAGS: '-I/opt/homebrew/opt/llvm/include'
LDFLAGS: "-L/opt/homebrew/opt/llvm/lib"
CPPFLAGS: "-I/opt/homebrew/opt/llvm/include"
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
curl -fsSL https://bun.sh/install | bash
PATH=$HOME/.bun/bin:$PATH
brew update
brew install \
llvm@19 \
freeglut \
libpng \
meson \
ninja
brew install --cask xquartz
cd /opt/homebrew/opt/llvm/bin
#ln -s clang++ clang++-19
PATH=/opt/homebrew/opt/llvm/bin:$PATH
echo "PATH=$PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Install dependencies
run: |
curl -fsSL https://bun.sh/install | bash
PATH=$HOME/.bun/bin:$PATH
brew update
brew install \
llvm@19 \
freeglut \
libpng \
meson \
ninja
brew install --cask xquartz
cd /opt/homebrew/opt/llvm/bin
#ln -s clang++ clang++-19
PATH=/opt/homebrew/opt/llvm/bin:$PATH
echo "PATH=$PATH" >> $GITHUB_ENV
- name: Configure and build
run: |
cmake --version
bun install
bun run codegen
meson setup --reconfigure build/ --buildtype=release --native-file toolchains/flatpak.ini
# Unclear fix to be investigated
rm subprojects/libtcc/VERSION
meson compile -C build/ vs:executable
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: macos14-meson-logs
path: |
build/meson-logs/**/*
- name: Configure and build
run: |
cmake --version
bun install
bun run codegen
meson setup -Dforce_x11_backend=true --reconfigure build/ --buildtype=release --native-file toolchains/flatpak.ini
# Unclear fix to be investigated
rm subprojects/libtcc/VERSION
meson compile -C build/ vs:executable
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: macos14-meson-logs
path: |
build/meson-logs/**/*
96 changes: 48 additions & 48 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,65 @@ on:
pull_request:
branches: master
paths:
- 'docker/**'
- '!**.md'
- '**docker-test.yml'
- "docker/**"
- "!**.md"
- "**docker-test.yml"

jobs:
build-test-env-image:
runs-on: ubuntu-latest
env:
DOCKER_CACHE_DEST: ${{ github.workspace }}/.docker/buildx-cache
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set variables
run: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
echo "OWNER_LC=$OWNER_LC" >>${GITHUB_ENV}
echo "IMAGE=ghcr.io/$OWNER_LC/vs-fltk:build-env" >>${GITHUB_ENV}
- name: Set variables
run: |
OWNER_LC=${GITHUB_REPOSITORY_OWNER,,}
echo "OWNER_LC=$OWNER_LC" >>${GITHUB_ENV}
echo "IMAGE=ghcr.io/$OWNER_LC/vs-fltk:build-env" >>${GITHUB_ENV}
- name: Check if Dockerfile has changed
run: |
echo "do_build=false" >> $GITHUB_ENV
if [ "${{ github.ref }}" != "refs/heads/master" ]; then
FILES=$(git diff --name-only HEAD~1 HEAD)
if echo "$FILES" | grep -qE "^docker/Dockerfile$"; then
echo "do_build=true" >> $GITHUB_ENV
- name: Check if Dockerfile has changed
run: |
echo "do_build=false" >> $GITHUB_ENV
if [ "${{ github.ref }}" != "refs/heads/master" ]; then
FILES=$(git diff --name-only HEAD~1 HEAD)
if echo "$FILES" | grep -qE "^docker/Dockerfile$"; then
echo "do_build=true" >> $GITHUB_ENV
fi
fi
fi
- name: Cache Docker layers
if: ${{ env.do_build == 'true' }}
id: docker-cache
uses: actions/cache@v4
with:
path: ${{ env.DOCKER_CACHE_DEST }}
key: ${{ runner.os }}-docker-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-docker-
- name: Cache Docker layers
if: ${{ env.do_build == 'true' }}
id: docker-cache
uses: actions/cache@v4
with:
path: ${{ env.DOCKER_CACHE_DEST }}
key: ${{ runner.os }}-docker-${{ github.ref_name }}
restore-keys: |
${{ runner.os }}-docker-
- name: Set up Docker Buildx
if: ${{ env.do_build == 'true' }}
uses: docker/setup-buildx-action@v3
- name: Set up Docker Buildx
if: ${{ env.do_build == 'true' }}
uses: docker/setup-buildx-action@v3

- name: Build Docker image
if: ${{ env.do_build == 'true' }}
run: |
docker buildx build \
./docker \
-f docker/Dockerfile \
-t $IMAGE \
--cache-to=type=local,dest=${{ env.DOCKER_CACHE_DEST }} \
--cache-from=type=local,src=${{ env.DOCKER_CACHE_DEST }} \
--load
- name: Build Docker image
if: ${{ env.do_build == 'true' }}
run: |
docker buildx build \
./docker \
-f docker/Dockerfile \
-t $IMAGE \
--cache-to=type=local,dest=${{ env.DOCKER_CACHE_DEST }} \
--cache-from=type=local,src=${{ env.DOCKER_CACHE_DEST }} \
--load
- name: Run commands in Docker container
run: |
export HOSTUID=$(id -u) HOSTGID=$(id -g)
docker compose -f docker/docker-compose.yml run --rm dev
env:
ENTRYPOINT: /entry-build.sh
WORKSPACE: ${{ github.workspace }}/vs-workspace
- name: Run commands in Docker container
run: |
export HOSTUID=$(id -u) HOSTGID=$(id -g)
docker compose -f docker/docker-compose.yml run --rm dev
env:
ENTRYPOINT: /entry-build.sh
WORKSPACE: ${{ github.workspace }}/vs-workspace
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:
push:
branches: master
paths:
- '**Dockerfile'
- '**docker.yml'
- "**Dockerfile"
- "**docker.yml"
workflow_dispatch:
schedule:
- cron: '25 1 5 * *'
- cron: "25 1 5 * *"

jobs:
build-env-image:
Expand All @@ -21,7 +21,7 @@ jobs:
run: |
echo "OWNER_LC=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
OWNER: "${{ github.repository_owner }}"
- name: Checkout
uses: actions/checkout@v4

Expand Down
7 changes: 3 additions & 4 deletions MILESTONES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ For past releases please check in [here](./docs/releases/).

## 0.1.1-alpha

- [x] Complete the build process
- [x] Complete the build/install process
- [x] Docker image
- [x] Flatpak building pipeline
- [x] Prepare pipeline for github actions
Expand All @@ -14,12 +14,11 @@ For past releases please check in [here](./docs/releases/).
- [ ] Implement flex, grid, scroll & pack via codegen.
- [ ] Tidy up the XML caching
- [ ] Tidy up the JS scripting interface.
- [x] Complete the build process
- [x] Flatpak building pipeline
- [ ] deb package

## 0.1.5

- [x] Move all components to the new codegen format
- [x] Move all components to the codegen format
- [x] Support for script modules
- [ ] Full support for getters and setters
- [x] Final implementation of the static xml builder (now external dependency)
Expand Down
7 changes: 6 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ The main objective is to implement & test most of the pipelines needed to:
- the generation of its flatpak image

Still, `vs` is somewhat usable as a technical preview.
For now, the building pipeline is not well documented and it can be hard to replicate. Also, installing it on most distributions might cause issues with your past or future dependencies. Still, you should be able to try it out via flatpak and the docker image provided by @andy5995.
For now, the building pipeline is not well documented, and it can be hard to replicate.
Also, installing it on most distributions might cause issues with your past or future dependencies.
Still, you should be able to try it out via flatpak and the docker image provided by @andy5995.
I am seeking feedback, so you are very welcome to test it along!

For reference, you can check what is the [intended scope](./README.md) of this project in terms of future developments and expected features.
The [milestone](./docs/milestones.md) page also contains some related information.

### What's new?

This is what has been implemented so far (and some missing feature for context):

- Basic CLI features for the command `vs`. These are not expected to change for quite a while.
Expand Down Expand Up @@ -57,3 +61,4 @@ This is what has been implemented so far (and some missing feature for context):
- Install process mostly implemented in meson (the pre-build codegen step will stay in typescript).
- Functional flatpak build
- A docker image for development
- Initial CI integrations
Loading

0 comments on commit 70c58b7

Please sign in to comment.