A collection of +180 reusable WebAssembly modules for building composable CI/CD pipelines with FluentCI fluentci.io/modules
modules artifacts gh-artifacts
2 folders · 17 files

src
test
.gitignore
build.mjs
COMPONENT.md
entry.mjs
fluentci-module.toml
fluentci.lock
legacy-entry.mjs
legacy-schema.json
LICENSE
module-dependencies.json
OPTIONS.md
package-lock.json
package.json
README.md
schema.json
spago.lock
spago.yaml
README.md

GitHub artifacts #

Native WebAssembly component written in PureScript. Requires FluentCI v0.17.3+. Function signatures and argument descriptions come from the compiled PureScript source and are embedded in the component; no raw JSON plugin input is required.

Usage #

fluentci run gh-artifacts upload --project . --run-dir .fluentci/runs/gh-artifacts-001 --name build-artifact --files dist/app.zip
fluentci run gh-artifacts --help
fluentci run gh-artifacts upload --help

See COMPONENT.md for every named argument, description, required flag, and return type. The schema describes the same contract. Optional values retain the native module defaults. Lists use comma-separated strings; boolean arguments accept switches. Native function/flag names use kebab-case.

Requirements and behavior #

Use setup-gh-artifacts to install gh and the official @actions/artifact client. Job-artifact upload is GitHub Actions-only and needs ACTIONS_RUNTIME_TOKEN/ACTIONS_RESULTS_URL; outside Actions, use release_upload or another artifact backend. GH_TOKEN authenticates gh operations. FLUENTCI_GH_ARTIFACT_CLIENT selects the installed client module. Uploaded job artifacts are immutable; choose unique names per producer. Download by run ID or release tag for downstream stages.

The return value is a typed record containing outcome, run-dir, report-path, stdout-path, and stderr-path. Each invocation needs a fresh run directory. Native command failures, cancellation, and timeouts fail the component call. Use --artifacts package=dist/package.zip to declare output files for the execution report. Authentication stays in native configuration or host environment.

Development #

From this module directory, with Node.js, Bun, PureScript, and Spago installed:

bun install --cwd ../../lib/component --frozen-lockfile
npm ci
npm run build
npm test

dist/plugin.wasm is the native component; dist/fluentci.metadata.json is its checksummed contract sidecar. The CJS bundles and legacy-entry.mjs exist only for private regression tests and are not the published module interface.

See the component migration guide and MIT License.

Setup component dependency #

This module declares setup-gh-artifacts as typed native component dependencies. FluentCI v0.17.3+ resolves their source references while building and composes them into the published Wasm. Consumers need no relative source paths. Available tools are reused; missing prerequisites invoke setup with default arguments. Explicit executable overrides remain caller-managed. Configure pinned versions or privileged/custom installations in an earlier setup step. See dependency behavior and publishing for command-specific prerequisites, validation, credential skips, and CI coverage.

The public module name is gh-artifacts, with the companion setup-gh-artifacts. List arguments such as files, name, pattern, arguments and artifacts accept comma-separated strings. Whitespace is trimmed; malformed CSV and empty entries are rejected before host commands. CSV double quotes preserve literal commas inside a token. The native gh command, official @actions/artifact package and FLUENTCI_GH_ARTIFACT_CLIENT environment variable keep their existing names.

Compose this module from code #

Requires FluentCI 0.17.6 or newer for generated pipeline bindings. From your caller module's directory, add the dependency:

fluentci add gh-artifacts --path /path/to/fluentci-modules/artifacts/gh-artifacts

For a published module, use fluentci add @fluentci.io/gh-artifacts@VERSION with an available version. Commit the caller's manifest and lockfile. FluentCI generates named bindings from the installed component's WIT; no handwritten FFI or CLI subprocess is needed. Include generated source directories in the caller's SDK project. The callee can use a different SDK from the caller.

Upload job artifacts using GitHub Actions runtime credentials and the official artifact client.

Replace the sample organization, paths and identifiers with your own. Configure credentials through your CI secret provider before running authenticated operations. Optional arguments use the callee's defaults, and public list fields use comma-separated strings. See COMPONENT.md for argument descriptions and return types.

These examples use the generated composition API and builder chaining in FluentCI 0.17.6; full cross-SDK compilation and execution coverage is still pending. See composition support and limitations.

PureScript #

module Main where

import Prelude
import Effect (Effect)
import FluentCI.Flow as Flow
import FluentCI.Modules.GhArtifacts as GhArtifacts

run :: Effect String
run =
  Flow.pipeline "gh-artifacts-upload"
    # Flow.workdir "."
    # GhArtifacts.upload (GhArtifacts.uploadArgs { "name": "api", "files": "dist/api.tar.gz,dist/api.tar.gz.sha256" })
    # Flow.map (\result -> result.reportPath)
    # Flow.run

Gleam #

import fluentci/flow
import fluentci_modules/gh_artifacts

pub fn run() -> String {
  flow.pipeline("gh-artifacts-upload")
  |> flow.workdir(".")
  |> gh_artifacts.upload(gh_artifacts.upload_args("api", "dist/api.tar.gz,dist/api.tar.gz.sha256"))
  |> flow.map(fn(result) { result.report_path })
  |> flow.run
}

Use Gleam's JavaScript target for the Wasm guest. BEAM escripts used for repository automation are separate from component guests.

Elixir #

defmodule Main do
  use FluentCI.Plugin
  alias FluentCI.Flow
  alias FluentCI.Modules.GhArtifacts

  defplugin run do
    Flow.pipeline("gh-artifacts-upload")
    |> Flow.workdir(".")
    |> GhArtifacts.upload(%{"name" => "api", "files" => "dist/api.tar.gz,dist/api.tar.gz.sha256"})
    |> Flow.stdout()
  end
end

Elixir compiles this sequence to Rust/Wasm. Its initial Flow API does not yet provide the typed result callbacks or cleanup combinators of the other examples.

ClojureScript #

(ns main.plugin
  (:require [fluentci.flow :as flow]
            [fluentci-modules.gh-artifacts :as gh_artifacts]))

(defn run []
  (-> (flow/pipeline "gh-artifacts-upload")
      (flow/workdir ".")
      (gh_artifacts/upload {:name "api", :files "dist/api.tar.gz,dist/api.tar.gz.sha256"})
      flow/run!))

ReScript #

let run = (): string =>
  Flow.pipeline("gh-artifacts-upload")
  ->Flow.workdir(".")
  ->FluentciModulesGhArtifacts.upload(FluentciModulesGhArtifacts.uploadArgs(~name="api", ~files="dist/api.tar.gz,dist/api.tar.gz.sha256"))
  ->Flow.map(result => result.reportPath)
  ->Flow.run

Python #

from fluentci.flow import pipeline
from fluentci_modules import gh_artifacts


def run() -> str:
    return (
        pipeline("gh-artifacts-upload")
        .workdir(".")
        .pipe(gh_artifacts.upload, {"name": "api", "files": "dist/api.tar.gz,dist/api.tar.gz.sha256"})
        .map(lambda result: result.report_path)
        .run()
    )

TypeScript #

import * as flow from "./fluentci_modules/flow";
import * as gh_artifacts from "./fluentci_modules/gh-artifacts/index";

export function run(): string {
  return flow.pipeline("gh-artifacts-upload")
    .workdir(".")
    .pipe(gh_artifacts.upload, {"name":"api","files":"dist/api.tar.gz,dist/api.tar.gz.sha256"})
    .map(result => result.reportPath)
    .run();
}

Python and TypeScript use FluentCI builder chains: .pipe(module.function, args) composes generated module functions with .workdir, .env, and .exec. Functions return a pipeline carrying their typed result. Use a generated result callback (With/_with, or a callback argument in TypeScript/Python) when a later module needs a preceding result; use Flow's map operation to select a result field. Execution begins at run (or the Elixir plugin terminal), in declared order.

Exported functions #

Function Purpose
run Execute arbitrary literal CLI arguments.
version Print the CLI version.
upload Upload job artifacts using GitHub Actions runtime credentials and the official artifact client.
download download
release_upload release upload
release_download release download