Skip to content

Added cut off for file drops to avoid large listing. #167

Added cut off for file drops to avoid large listing.

Added cut off for file drops to avoid large listing. #167

Workflow file for this run

name: Archlinux Build & Frontend
on:
push:
tags:
- "v*"
pull_request:
branches: ["main"]
env:
BUILD_TYPE: Release
BUILD_DIR: build/clang_release
jobs:
archlinux:
runs-on: ubuntu-latest
container:
image: archlinux:base-devel
steps:
- name: Install dependencies
run: |
pacman -Syu --noconfirm
pacman -S --noconfirm \
cmake \
ninja \
clang \
lld \
git \
zip \
tar \
python \
nodejs \
webkitgtk-6.0 \
curl \
crypto++ \
libssh \
fmt \
boost \
boost-libs \
aws-cli-v2 \
github-cli \
nlohmann-json \
zlib \
bzip2 \
zstd \
xz
- uses: actions/checkout@v6
with:
fetch-tags: true
fetch-depth: 0
submodules: recursive
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Test node
run: node --version && whereis node
- name: Configure CMake
run: |
git config --global --add safe.directory "$(pwd)"
cmake \
-B "${{ env.BUILD_DIR }}" \
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_LINKER=lld \
-DCMAKE_CXX_EXTENSIONS=on \
-DCMAKE_CXX_STANDARD=23 \
-DJSON_Diagnostics=ON \
-DNUI_FETCH_TRAITS=OFF \
-DNUI_SFTP_ENABLE_TESTING=ON \
- name: Build
run: |
cmake --build \
"${{ env.BUILD_DIR }}" \
--config "${{ env.BUILD_TYPE }}"
- name: Run Tests
run: |
ctest \
--test-dir "${{ env.BUILD_DIR }}" \
--build-config "${{ env.BUILD_TYPE }}" \
--output-on-failure
- name: Run Deploy
run: |
bash scripts/deploy.sh
- name: Read version information
run: |
cat ${{ env.BUILD_DIR }}/text/version.txt
VERSION_FILE="${{ env.BUILD_DIR }}/text/version.txt"
VERSION=$(sed -n '1p' "$VERSION_FILE")
VERSION_CLEAN=$(sed -n '2p' "$VERSION_FILE")
{
echo "VERSION=$VERSION"
echo "VERSION_CLEAN=$VERSION_CLEAN"
} >> "$GITHUB_ENV"
- name: Zip frontend
run: |
cd "${{ env.BUILD_DIR }}" && tar -czf "nui-sftp-linux-frontend_${{ env.VERSION }}.tar.gz" frontend
- name: Build standalone licenses tarball
run: |
# The cmake build already produced licenses.json (and embedded it
# into the WASM binary). This step only repackages it as a release
# artifact for inspection outside the app.
python scripts/build_licenses_bundle.py \
--out "${{ env.BUILD_DIR }}/licenses.json" \
--tarball "${{ env.BUILD_DIR }}/nui-sftp-licenses_${{ env.VERSION }}.tar.gz" \
--npm-licenses "${{ env.BUILD_DIR }}/generated/licenses/npm-licenses.json"
- name: Upload Artifact to Release
if: startsWith(github.ref, 'refs/tags/v')
env:
GH_TOKEN: ${{ secrets.RELEASEUPLOADPAT }}
run: |
gh release upload "v${{ env.VERSION_CLEAN }}" "${{ env.BUILD_DIR }}/nui-sftp-linux-frontend_${{ env.VERSION }}.tar.gz"
gh release upload "v${{ env.VERSION_CLEAN }}" "${{ env.BUILD_DIR }}/nui-sftp-licenses_${{ env.VERSION }}.tar.gz"
- name: Upload artifacts to MEGA S4
if: startsWith(github.ref, 'refs/tags/v')
env:
AWS_ACCESS_KEY_ID: ${{ secrets.MEGAS4ACCESS }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.MEGAS4KEY }}
ENDPOINT: https://s3.eu-central-1.s4.mega.io
run: |
upload_if_absent() {
local filename="$1"
local s3_path="$2"
if aws s3 ls "${s3_path}${filename}" --endpoint-url "${ENDPOINT}" > /dev/null 2>&1; then
echo "Skipping: ${filename} already exists in S4."
return 0
fi
aws s3 cp "${{ env.BUILD_DIR }}/${filename}" "${s3_path}" --endpoint-url "${ENDPOINT}"
}
upload_if_absent "nui-sftp-linux-frontend_${{ env.VERSION }}.tar.gz" "s3://nui-sftp-releases/linux-frontend/"
upload_if_absent "nui-sftp-licenses_${{ env.VERSION }}.tar.gz" "s3://nui-sftp-releases/licenses/"