-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-configured Docker to build Linux release;
-added release ci config
- Loading branch information
1 parent
7d53e41
commit 6f6b5de
Showing
3 changed files
with
87 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: [ "v*" ] | ||
|
||
jobs: | ||
build-windows: | ||
name: Build Windows version | ||
runs-on: windows-latest | ||
steps: | ||
- name: Install ninja | ||
run: choco install ninja | ||
|
||
- uses: actions/checkout@v4 | ||
- uses: rui314/setup-mold@v1 | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- name: Configure CMake | ||
run: cmake --preset=msvc-release -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release | ||
|
||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config Release | ||
|
||
- name: Upload build artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: hypertextcpp-windows-latest | ||
path: | | ||
${{github.workspace}}/build/hypertextcpp.exe | ||
release_hypertextcpp: | ||
name: Release hypertextcpp | ||
runs-on: ubuntu-latest | ||
needs: build-windows | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build linux version in Docker | ||
run: DOCKER_BUILDKIT=1 docker build --build-arg cmake_preset=clang-release --output build . | ||
|
||
- name: Run unit tests | ||
working-directory: ${{github.workspace}}/build/tests | ||
run: ./test_hypertextcpp | ||
|
||
- name: Download hypertextcpp Windows build | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: hypertextcpp-windows-latest | ||
path: build | ||
- name: Upload release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
build/hypertextcpp | ||
build/hypertextcpp.exe | ||
shared_lib_api/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM alpine:3.18.3 AS hypertextcpp-build-container | ||
ARG cmake_preset | ||
RUN apk update && \ | ||
apk add --no-cache \ | ||
git \ | ||
build-base \ | ||
ccache \ | ||
cmake \ | ||
clang \ | ||
clang-dev \ | ||
mold \ | ||
samurai | ||
|
||
WORKDIR /hypertextcpp_src | ||
COPY external ./external/ | ||
COPY src ./src/ | ||
COPY tests ./tests/ | ||
COPY CMakeLists.txt . | ||
COPY CMakePresets.json . | ||
RUN cmake --preset "$cmake_preset" -B build -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_EXE_LINKER_FLAGS="-static" -DENABLE_TESTS=ON | ||
RUN cmake --build build | ||
RUN strip --strip-all build/hypertextcpp | ||
|
||
|
||
FROM scratch AS hypertextcpp-build | ||
COPY --from=hypertextcpp-build-container /hypertextcpp_src/build/hypertextcpp . | ||
COPY --from=hypertextcpp-build-container /hypertextcpp_src/build/tests/test_hypertextcpp ./tests/ |