Skip to content

Commit 7b52d91

Browse files
committed
Added Ubuntu workflow.
1 parent e53c784 commit 7b52d91

1 file changed

Lines changed: 123 additions & 0 deletions

File tree

.github/workflows/ubuntu_24.yml

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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
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 "${{ env.WSPACE }}" && bash setup.sh
62+
63+
- name: Configure CMake
64+
run: |
65+
cmake \
66+
-B "${{ env.WSPACE }}/${{ 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+
81+
- name: Build
82+
run: |
83+
cmake --build \
84+
"${{ env.WSPACE }}/${{ env.BUILD_DIR }}" \
85+
--config "${{ env.BUILD_TYPE }}"
86+
87+
- name: Read version information
88+
run: |
89+
VERSION_FILE="${{ env.WSPACE }}/${{ env.BUILD_DIR }}/text/version.txt"
90+
VERSION=$(sed -n '1p' "$VERSION_FILE")
91+
VERSION_CLEAN=$(sed -n '2p' "$VERSION_FILE")
92+
{
93+
echo "VERSION=$VERSION"
94+
echo "VERSION_CLEAN=$VERSION_CLEAN"
95+
} >> "$GITHUB_ENV"
96+
97+
# Output lands in ${{ env.WSPACE }}/${{ env.BUILD_DIR }}/build/install
98+
- name: Run deploy script
99+
run: |
100+
cd "${{ env.WSPACE }}" && bash scripts/deploy.sh
101+
102+
- name: Zip deployed files
103+
run: |
104+
cd "${{ env.WSPACE }}" && \
105+
zip -r "nui-sftp-ubuntu-24-x86_64_${{ env.VERSION }}.zip" "${{ env.WSPACE }}/build/install"
106+
107+
- name: Upload artifacts to MEGA S4
108+
# if: github.ref == 'refs/heads/main'
109+
env:
110+
AWS_ACCESS_KEY_ID: ${{ secrets.MEGAS4ACCESS }}
111+
AWS_SECRET_ACCESS_KEY: ${{ secrets.MEGAS4KEY }}
112+
ENDPOINT: https://s3.eu-central-1.s4.mega.io
113+
FILENAME: "nui-sftp-ubuntu-24-x86_64_${{ env.VERSION }}.zip"
114+
S3_PATH: "s3://nui-sftp-releases/ubuntu-24/x86_64/"
115+
run: |
116+
# 1. Check if the file exists on the remote S4 storage
117+
# We point to the full URI: s3://bucket/path/filename.zip
118+
if aws s3 ls "${{ env.S3_PATH }}${{ env.FILENAME }}" --endpoint-url ${{ env.ENDPOINT }} > /dev/null 2>&1; then
119+
echo "::error::Deployment failed: ${{ env.FILENAME }} already exists in S4. Aborting to prevent overwrite."
120+
exit 1
121+
fi
122+
123+
aws s3 cp "${{ env.FILENAME }}" "${{ env.S3_PATH }}" --endpoint-url ${{ env.ENDPOINT }}

0 commit comments

Comments
 (0)