Skip to content

Commit

Permalink
package cli
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcheng1982 committed Oct 10, 2024
1 parent c263d73 commit a0dd373
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 11 deletions.
34 changes: 31 additions & 3 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Publish package to the Maven Central Repository
name: Publish and Release
permissions:
contents: write

on:
release:
types: [ created ]
push:
tags:
- v[0-9]+.*
jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -23,3 +27,27 @@ jobs:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: cli
path: |
cli/target/cli-jar-with-dependencies.jar
retention-days: 1
- uses: actions/download-artifact@v4
with:
name: cli

- name: Rename files
run: |
mkdir release-files
mv cli-jar-with-dependencies.jar release-files/llm-agent-builder-cli.jar
- name: Create a Github Release
uses: ncipollo/release-action@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
body: ${{ github.ref_name }}
artifacts: "release-files/*"
generateReleaseNotes: true
30 changes: 30 additions & 0 deletions cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,34 @@
<version>1.9.22</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.7.1</version>
<configuration>
<finalName>cli</finalName>
<descriptors>
<descriptor>src/assembly/cli.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>io.github.llmagentbuilder.cli.CliApplicationKt
</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
22 changes: 22 additions & 0 deletions cli/src/assembly/cli.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 https://maven.apache.org/xsd/assembly-2.2.0.xsd">
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
<containerDescriptorHandlers>
<containerDescriptorHandler>
<handlerName>metaInf-services</handlerName>
</containerDescriptorHandler>
</containerDescriptorHandlers>
</assembly>
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,22 @@ import io.github.llmagentbuilder.cli.command.BuildCommand
import io.github.llmagentbuilder.cli.command.RunCommand
import picocli.CommandLine
import java.io.File
import java.util.concurrent.Callable
import kotlin.system.exitProcess

@CommandLine.Command(
name = "llm-agent-builder",
mixinStandardHelpOptions = true,
version = ["0.2.0"],
version = ["0.3.0"],
description = ["Build LLM agents"],
subcommands = [RunCommand::class, BuildCommand::class],
)
class CliApplication : Callable<Void> {
class CliApplication {
@CommandLine.Option(
names = ["-c", "--config"],
description = ["agent config file"]
description = ["agent config file"],
required = true,
)
lateinit var configFile: File

override fun call(): Void? {
return null
}
}

fun main(args: Array<String>): Unit =
Expand Down

0 comments on commit a0dd373

Please sign in to comment.