diff --git a/.fluentci/plugin/src/lib.rs b/.fluentci/plugin/src/lib.rs index 9d7a5c0221..3650ac9584 100644 --- a/.fluentci/plugin/src/lib.rs +++ b/.fluentci/plugin/src/lib.rs @@ -6,6 +6,84 @@ mod helpers; use helpers::detect_system; +#[plugin_fn] +pub fn build(_arg: String) -> FnResult { + let stdout = dag() + .pipeline("build")? + .pkgx()? + .with_workdir("./webui/rockbox")? + .with_exec(vec!["sudo", "apt-get", "update"])? + .with_exec(vec![ + "sudo", + "apt-get install", + "-y", + "build-essential", + "libusb-dev", + "libsdl2-dev", + "libfreetype6-dev", + "libunwind-dev", + "curl", + "wget", + "zip", + "unzip", + "cmake", + ])? + .with_exec(vec![ + "pkgm", + "install", + "zig@0.13.0", + "buf", + "deno", + "bun", + "node@18", + ])? + .with_exec(vec!["deno install"])? + .with_exec(vec!["deno", "run", "build"])? + .stdout()?; + + // download & install protoc + dag() + .pipeline("protoc")? + .pkgx()? + .with_exec(vec![ + "git", + "clone", + "https://github.com/protocolbuffers/protobuf", + ])? + .with_exec(vec![ + "cd protobuf &&", + "git checkout v29.2 &&", + "git submodule update --init --recursive &&", + "mkdir build &&", + "cd build &&", + "cmake .. && sudo make install -j$(nproc)", + ])? + .stdout()?; + + dag() + .pipeline("mkdir")? + .pkgx()? + .with_exec(vec!["mkdir", "-p", "build"])? + .stdout()?; + + dag() + .pipeline("build")? + .pkgx()? + .with_workdir("build")? + .with_exec(vec![ + "../tools/configure", + "--target=sdlapp", + "--type=N", + "--lcdwidth=320", + "--lcdheight=240", + "--prefix=/usr/local", + ])? + .with_exec(vec!["sudo", "make", "ziginstall", "-j$(nproc)"])? + .stdout()?; + + Ok(stdout) +} + #[plugin_fn] pub fn release(_args: String) -> FnResult { let tag = dag().get_env("TAG")?; @@ -129,7 +207,7 @@ pub fn release(_args: String) -> FnResult { } #[plugin_fn] -pub fn build(args: String) -> FnResult { +pub fn build_docker(args: String) -> FnResult { let version = dag() .get_env("BUILDX_VERSION") .unwrap_or("v0.17.1-desktop.1".into()); diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..fa4bc8d3e5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: release +on: + push: + tags: + - "*" + workflow_dispatch: + inputs: + tag: + description: "The existing tag to publish" + type: "string" + required: true + +jobs: + publish: + strategy: + matrix: + os: [ubuntu-22.04, ubuntu-22.04-arm] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - name: Build and upload release + uses: fluentci-io/setup-fluentci@v5 + with: + wasm: true + plugin: . + args: | + build + release + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ inputs.tag || github.ref_name }} diff --git a/Dockerfile b/Dockerfile index f3720948b9..e17518b13c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,8 +50,6 @@ ENV PATH=/root/.local/bin:${PATH} WORKDIR /app -RUN [ -n "$TAG" ] && fluentci run --wasm . release ; exit 0 - FROM debian:bookworm RUN apt-get update && apt-get install -y \