Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 26 additions & 22 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
mvn --no-transfer-progress -DskipTests clean package

- name: Publish to the Maven Central Repository
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
run: |
mvn --no-transfer-progress --batch-mode deploy
env:
Expand All @@ -58,17 +59,9 @@ jobs:
- name: Cache Jars
uses: actions/upload-artifact@v4
with:
name: scanoss-jars
name: scanoss-jars-maven
path: ./target/*.jar

# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# draft: true
# files: |
# target/*.jar
# scanoss-cli.sh

# Build all the native binaries for the given OSes
build_native:
if: success()
Expand All @@ -77,7 +70,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-11, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -137,16 +130,25 @@ jobs:
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: scanoss-jars
name: scanoss-jars-${{ matrix.os }}
path: ./target/scanoss-java-${{ matrix.os }}

- name: Cache ${{ matrix.os }} Binary Windows
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: scanoss-jars
name: scanoss-jars-${{ matrix.os }}
path: ./target/scanoss-java-${{ matrix.os }}.exe


merge:
runs-on: ubuntu-latest
needs: [build_jars, build_native]
steps:
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
with:
name: scanoss-jars
pattern: scanoss-jars-*

# Upload all the jars and binaries a GH Release
create_release:
Expand All @@ -160,20 +162,22 @@ jobs:
- name: Download Cached artifacts
uses: actions/download-artifact@v4
with:
name: scanoss-jars
pattern: scanoss-jars-*
merge-multiple: true
path: target

- name: List Packages
continue-on-error: true
run: |
ls -la target/

# Only create a release if we have a tagged push
- name: Release ${{ github.ref_type }} - ${{ github.ref_name }}
- name: GH Release ${{ github.ref_type }} - ${{ github.ref_name }}
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
target/*
scanoss-cli.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{github.ref_name}} \
--draft \
--repo ${{ github.server_url }}/${{ github.repository }} \
--generate-notes \
target/* scanoss-cli.sh
106 changes: 42 additions & 64 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@
</properties>

<distributionManagement>
<!-- <repository>-->
<!-- <id>github</id>-->
<!-- <name>GitHub SCANOSS Apache Maven Packages</name>-->
<!-- <url>https://maven.pkg.github.com/scanoss/scanoss.java</url>-->
<!-- </repository>-->
<snapshotRepository>
<id>ossrh</id>
<name>Maven Central Snapshot Repo</name>
Expand All @@ -62,58 +57,36 @@
</distributionManagement>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
<optional>true</optional>
</dependency>
<!-- Core compile dependencies -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.12.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp-tls</artifactId>
<version>4.12.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.17.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4jVersion}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>2.9.2</version>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.6</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand All @@ -125,6 +98,42 @@
<groupId>com.github.package-url</groupId>
<artifactId>packageurl-java</artifactId>
<version>1.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>info.picocli</groupId>
<artifactId>picocli</artifactId>
<version>4.7.6</version>
<optional>true</optional>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
<optional>true</optional>
<scope>compile</scope>
</dependency>


<!-- Test dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4jVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.12.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
Expand Down Expand Up @@ -172,34 +181,6 @@
</descriptorRefs>
</configuration>
</execution>
<execution>
<id>without-slf4j</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<inlineDescriptors>
<inlineDescriptor>
<id>with-dependencies-exclude-slf4j-simple</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<excludes>
<exclude>org.slf4j:slf4j-simple</exclude>
</excludes>
</dependencySet>
</dependencySets>
</inlineDescriptor>
</inlineDescriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down Expand Up @@ -283,12 +264,9 @@
<buildArg>-H:+ReportExceptionStackTraces</buildArg>
<buildArg>-H:ReflectionConfigurationFiles=../config/reflect-config.json</buildArg>
<buildArg>-H:ResourceConfigurationFiles=../config/resource-config.json</buildArg>
<!-- <buildArg>-H:+StaticExecutableWithDynamicLibC</buildArg> -->
<buildArg>--verbose</buildArg>
<buildArg>--no-fallback</buildArg>
<buildArg>-march=native</buildArg>
<!-- For Quick Build (22.1+) -->
<!-- <buildArg>-Ob</buildArg>-->
</buildArgs>
</configuration>
</plugin>
Expand Down
Loading