Skip to content

Commit 0b3fdb3

Browse files
committed
Added Ubuntu workflow.
1 parent e53c784 commit 0b3fdb3

2 files changed

Lines changed: 126 additions & 1 deletion

File tree

.github/workflows/ubuntu_24.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
name: Ubuntu24
2+
3+
on:
4+
push:
5+
branches: ["main", "feat/pipelines"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
env:
10+
BUILD_TYPE: Release
11+
BUILD_DIR: build/clang_release
12+
13+
jobs:
14+
ubuntu-24:
15+
runs-on: ubuntu-24.04
16+
17+
defaults:
18+
run:
19+
shell: bash
20+
21+
steps:
22+
- uses: actions/checkout@v6
23+
24+
- uses: awalsh128/cache-apt-pkgs-action@latest
25+
with:
26+
packages: >-
27+
zip
28+
unzip
29+
git
30+
python3
31+
cmake
32+
libwebkit2gtk-4.1-dev
33+
libcurl4-openssl-dev
34+
libcrypto++-dev
35+
libpugixml-dev
36+
libssh-dev
37+
libfmt-dev
38+
ninja-build
39+
version: 1.0
40+
41+
- name: Install boost
42+
uses: MarkusJx/install-boost@v2.4.1
43+
id: install-boost
44+
with:
45+
# REQUIRED: Specify the required boost version
46+
# A list of supported versions can be found here:
47+
# https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json
48+
boost_version: 1.89.0
49+
# OPTIONAL: Specify a platform version
50+
platform_version: 24.04
51+
52+
- uses: actions/setup-node@v6
53+
with:
54+
node-version: 24
55+
56+
- name: Test node
57+
run: node --version && whereis node
58+
59+
- name: Run setup.sh
60+
run: |
61+
cd "${{ github.workspace }}" && bash setup.sh
62+
63+
- name: Configure CMake
64+
run: |
65+
cmake \
66+
-B "${{ github.workspace }}/${{ env.BUILD_DIR }}" \
67+
-G Ninja \
68+
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
69+
-DCMAKE_C_COMPILER=clang \
70+
-DCMAKE_CXX_COMPILER=clang++ \
71+
-DCMAKE_LINKER=lld \
72+
-DCMAKE_CXX_EXTENSIONS=on \
73+
-DNUI_ENABLE_TESTS=off \
74+
-DNUI_BUILD_EXAMPLES=off \
75+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
76+
-DCMAKE_CXX_STANDARD=23 \
77+
-DJSON_Diagnostics=ON \
78+
-DNUI_FETCH_TRAITS=OFF \
79+
-DNUI_BUILD_XML_TOOL=ON \
80+
env:
81+
Boost_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
82+
83+
- name: Build
84+
run: |
85+
cmake --build \
86+
"${{ github.workspace }}/${{ env.BUILD_DIR }}" \
87+
--config "${{ env.BUILD_TYPE }}"
88+
89+
- name: Read version information
90+
run: |
91+
VERSION_FILE="${{ github.workspace }}/${{ env.BUILD_DIR }}/text/version.txt"
92+
VERSION=$(sed -n '1p' "$VERSION_FILE")
93+
VERSION_CLEAN=$(sed -n '2p' "$VERSION_FILE")
94+
{
95+
echo "VERSION=$VERSION"
96+
echo "VERSION_CLEAN=$VERSION_CLEAN"
97+
} >> "$GITHUB_ENV"
98+
99+
# Output lands in ${{ github.workspace }}/${{ env.BUILD_DIR }}/build/install
100+
- name: Run deploy script
101+
run: |
102+
cd "${{ github.workspace }}" && bash scripts/deploy.sh
103+
104+
- name: Zip deployed files
105+
run: |
106+
cd "${{ github.workspace }}" && \
107+
zip -r "nui-sftp-ubuntu-24-x86_64_${{ env.VERSION }}.zip" "${{ github.workspace }}/build/install"
108+
109+
- name: Upload artifacts to MEGA S4
110+
# if: github.ref == 'refs/heads/main'
111+
env:
112+
AWS_ACCESS_KEY_ID: ${{ secrets.MEGAS4ACCESS }}
113+
AWS_SECRET_ACCESS_KEY: ${{ secrets.MEGAS4KEY }}
114+
ENDPOINT: https://s3.eu-central-1.s4.mega.io
115+
FILENAME: "nui-sftp-ubuntu-24-x86_64_${{ env.VERSION }}.zip"
116+
S3_PATH: "s3://nui-sftp-releases/ubuntu-24/x86_64/"
117+
run: |
118+
# 1. Check if the file exists on the remote S4 storage
119+
# We point to the full URI: s3://bucket/path/filename.zip
120+
if aws s3 ls "${{ env.S3_PATH }}${{ env.FILENAME }}" --endpoint-url ${{ env.ENDPOINT }} > /dev/null 2>&1; then
121+
echo "::error::Deployment failed: ${{ env.FILENAME }} already exists in S4. Aborting to prevent overwrite."
122+
exit 1
123+
fi
124+
125+
aws s3 cp "${{ env.FILENAME }}" "${{ env.S3_PATH }}" --endpoint-url ${{ env.ENDPOINT }}

work_dependencies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"sources": [
33
{
44
"url": "https://github.com/5cript/work-dependency-cloner.git",
5-
"rev": "1b62276e6c47f408601cca8bcd69bd9d0e0b3046",
5+
"rev": "6451b7805ab9d327425f4f86a155e94870a570dd",
66
"branch": "main",
77
"name": "work-dependency-cloner"
88
},

0 commit comments

Comments
 (0)