Skip to content

Commit 4a89401

Browse files
committed
New workflow
1 parent 9e739e2 commit 4a89401

2 files changed

Lines changed: 69 additions & 4 deletions

File tree

.github/workflows/libx86_64.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build parserino libx86_64
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Lexbor Version'
8+
required: true
9+
default: '7fb22cf5664a331d7c24b113489e566767c9c25a'
10+
jobs:
11+
build-and-export:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
# Checkout the repository
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
# Set up Docker build
20+
- name: Build Docker image
21+
run: |
22+
echo "FROM alpine:latest
23+
RUN apk add vim gcc musl-dev ldc dub llvm-libunwind-static openssl-libs-static gzip git upx cmake make
24+
WORKDIR /app
25+
RUN git clone https://github.com/lexbor/lexbor.git
26+
RUN git checkout ${{ github.event.inputs.version }}
27+
RUN cmake . -DLEXBOR_BUILD_TESTS=OFF -DLEXBOR_BUILD_EXAMPLES=OFF -DLEXBOR_BUILD_SEPARATELY=OFF -DLEXBOR_BUILD_SHARED=OFF -DLEXBOR_BUILD_STATIC=ON
28+
RUN make -j3
29+
CMD mv liblexbor.a liblexbor_parserino_x86_64.a" > Dockerfile
30+
31+
docker build -t builder-image .
32+
33+
# Run the Docker container to build the project
34+
- name: Run Docker container and build project
35+
run: |
36+
docker run --name builder-container builder-image || true
37+
38+
# Copy compiled file from Docker container to host
39+
- name: Copy compiled binary
40+
run: |
41+
docker cp builder-container:/app/liblexbor_parserino_x86_64.a .
42+
docker rm builder-container
43+
44+
45+
# Upload the binary as an artifact
46+
- name: Upload binary as artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: lexbor_parserino_x86_64.
50+
path: liblexbor_parserino_x86_64.a

dub.sdl

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,22 @@ description "A super-fast HTML (HTML5!) parser and DOM editor, for D "
33
authors "Andrea Fontana"
44
copyright "Copyright © 2022-2025, Andrea Fontana"
55
license "MIT"
6-
preBuildCommands "dub --single build_lexbor_lib.d" platform="posix"
7-
libs "lexbor_parserino" platform="posix"
8-
lflags "-L$PACKAGE_DIR" platform="posix"
9-
copyFiles "dll/*.dll" platform="windows"
6+
7+
configuration "linux-prebuilt-lexbor" {
8+
platform "linux-x86_64"
9+
libs "lexbor_parserino_x86_64"
10+
lflags "-L$PACKAGE_DIR"
11+
}
12+
13+
configuration "windows-prebuilt-lexbor" {
14+
platform "windows-x86_64"
15+
copyFiles "dll/*.dll" platform="windows"
16+
}
17+
18+
configuration "fallback-lexbor" {
19+
platform "posix"
20+
preBuildCommands "dub --single build_lexbor_lib.d"
21+
libs "lexbor_parserino"
22+
lflags "-L$PACKAGE_DIR"
23+
}
24+

0 commit comments

Comments
 (0)