Skip to content

Commit b850cdd

Browse files
Merge pull request #21
fix: ES-117 pipeline and pom.xml
2 parents f1dea53 + e3a7619 commit b850cdd

File tree

2 files changed

+68
-86
lines changed

2 files changed

+68
-86
lines changed

.github/workflows/publish.yml

+26-22
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
mvn --no-transfer-progress -DskipTests clean package
4949
5050
- name: Publish to the Maven Central Repository
51+
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
5152
run: |
5253
mvn --no-transfer-progress --batch-mode deploy
5354
env:
@@ -58,17 +59,9 @@ jobs:
5859
- name: Cache Jars
5960
uses: actions/upload-artifact@v4
6061
with:
61-
name: scanoss-jars
62+
name: scanoss-jars-maven
6263
path: ./target/*.jar
6364

64-
# - name: Release
65-
# uses: softprops/action-gh-release@v1
66-
# with:
67-
# draft: true
68-
# files: |
69-
# target/*.jar
70-
# scanoss-cli.sh
71-
7265
# Build all the native binaries for the given OSes
7366
build_native:
7467
if: success()
@@ -77,7 +70,7 @@ jobs:
7770
runs-on: ${{ matrix.os }}
7871
strategy:
7972
matrix:
80-
os: [ubuntu-latest, macos-11, windows-latest]
73+
os: [ubuntu-latest, macos-latest, windows-latest]
8174
steps:
8275
- uses: actions/checkout@v4
8376

@@ -137,16 +130,25 @@ jobs:
137130
if: runner.os != 'Windows'
138131
uses: actions/upload-artifact@v4
139132
with:
140-
name: scanoss-jars
133+
name: scanoss-jars-${{ matrix.os }}
141134
path: ./target/scanoss-java-${{ matrix.os }}
142135

143136
- name: Cache ${{ matrix.os }} Binary Windows
144137
if: runner.os == 'Windows'
145138
uses: actions/upload-artifact@v4
146139
with:
147-
name: scanoss-jars
140+
name: scanoss-jars-${{ matrix.os }}
148141
path: ./target/scanoss-java-${{ matrix.os }}.exe
149-
142+
143+
merge:
144+
runs-on: ubuntu-latest
145+
needs: [build_jars, build_native]
146+
steps:
147+
- name: Merge artifacts
148+
uses: actions/upload-artifact/merge@v4
149+
with:
150+
name: scanoss-jars
151+
pattern: scanoss-jars-*
150152

151153
# Upload all the jars and binaries a GH Release
152154
create_release:
@@ -160,20 +162,22 @@ jobs:
160162
- name: Download Cached artifacts
161163
uses: actions/download-artifact@v4
162164
with:
163-
name: scanoss-jars
165+
pattern: scanoss-jars-*
166+
merge-multiple: true
164167
path: target
165168

166169
- name: List Packages
167170
continue-on-error: true
168171
run: |
169172
ls -la target/
170173
171-
# Only create a release if we have a tagged push
172-
- name: Release ${{ github.ref_type }} - ${{ github.ref_name }}
174+
- name: GH Release ${{ github.ref_type }} - ${{ github.ref_name }}
173175
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
174-
uses: softprops/action-gh-release@v1
175-
with:
176-
draft: true
177-
files: |
178-
target/*
179-
scanoss-cli.sh
176+
env:
177+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178+
run: |
179+
gh release create ${{github.ref_name}} \
180+
--draft \
181+
--repo ${{ github.server_url }}/${{ github.repository }} \
182+
--generate-notes \
183+
target/* scanoss-cli.sh

pom.xml

+42-64
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
</properties>
4545

4646
<distributionManagement>
47-
<!-- <repository>-->
48-
<!-- <id>github</id>-->
49-
<!-- <name>GitHub SCANOSS Apache Maven Packages</name>-->
50-
<!-- <url>https://maven.pkg.github.com/scanoss/scanoss.java</url>-->
51-
<!-- </repository>-->
5247
<snapshotRepository>
5348
<id>ossrh</id>
5449
<name>Maven Central Snapshot Repo</name>
@@ -62,58 +57,36 @@
6257
</distributionManagement>
6358

6459
<dependencies>
65-
<dependency>
66-
<groupId>junit</groupId>
67-
<artifactId>junit</artifactId>
68-
<version>4.13.2</version>
69-
<scope>test</scope>
70-
</dependency>
71-
<dependency>
72-
<groupId>com.squareup.okhttp3</groupId>
73-
<artifactId>mockwebserver</artifactId>
74-
<version>4.12.0</version>
75-
<scope>test</scope>
76-
</dependency>
77-
<dependency>
78-
<groupId>org.projectlombok</groupId>
79-
<artifactId>lombok</artifactId>
80-
<version>1.18.36</version>
81-
<optional>true</optional>
82-
</dependency>
60+
<!-- Core compile dependencies -->
8361
<dependency>
8462
<groupId>com.squareup.okhttp3</groupId>
8563
<artifactId>okhttp</artifactId>
8664
<version>4.12.0</version>
65+
<scope>compile</scope>
8766
</dependency>
8867
<dependency>
8968
<groupId>com.squareup.okhttp3</groupId>
9069
<artifactId>okhttp-tls</artifactId>
9170
<version>4.12.0</version>
71+
<scope>compile</scope>
9272
</dependency>
9373
<dependency>
9474
<groupId>commons-codec</groupId>
9575
<artifactId>commons-codec</artifactId>
9676
<version>1.17.1</version>
77+
<scope>compile</scope>
9778
</dependency>
9879
<dependency>
9980
<groupId>org.slf4j</groupId>
10081
<artifactId>slf4j-api</artifactId>
10182
<version>${slf4jVersion}</version>
102-
</dependency>
103-
<dependency>
104-
<groupId>org.slf4j</groupId>
105-
<artifactId>slf4j-simple</artifactId>
106-
<version>${slf4jVersion}</version>
83+
<scope>compile</scope>
10784
</dependency>
10885
<dependency>
10986
<groupId>org.apache.tika</groupId>
11087
<artifactId>tika-core</artifactId>
11188
<version>2.9.2</version>
112-
</dependency>
113-
<dependency>
114-
<groupId>info.picocli</groupId>
115-
<artifactId>picocli</artifactId>
116-
<version>4.7.6</version>
89+
<scope>compile</scope>
11790
</dependency>
11891
<dependency>
11992
<groupId>com.google.code.gson</groupId>
@@ -125,6 +98,42 @@
12598
<groupId>com.github.package-url</groupId>
12699
<artifactId>packageurl-java</artifactId>
127100
<version>1.5.0</version>
101+
<scope>compile</scope>
102+
</dependency>
103+
<dependency>
104+
<groupId>info.picocli</groupId>
105+
<artifactId>picocli</artifactId>
106+
<version>4.7.6</version>
107+
<optional>true</optional>
108+
<scope>compile</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.projectlombok</groupId>
112+
<artifactId>lombok</artifactId>
113+
<version>1.18.36</version>
114+
<optional>true</optional>
115+
<scope>compile</scope>
116+
</dependency>
117+
118+
119+
<!-- Test dependencies -->
120+
<dependency>
121+
<groupId>org.slf4j</groupId>
122+
<artifactId>slf4j-simple</artifactId>
123+
<version>${slf4jVersion}</version>
124+
<scope>runtime</scope>
125+
</dependency>
126+
<dependency>
127+
<groupId>junit</groupId>
128+
<artifactId>junit</artifactId>
129+
<version>4.13.2</version>
130+
<scope>test</scope>
131+
</dependency>
132+
<dependency>
133+
<groupId>com.squareup.okhttp3</groupId>
134+
<artifactId>mockwebserver</artifactId>
135+
<version>4.12.0</version>
136+
<scope>test</scope>
128137
</dependency>
129138
</dependencies>
130139
<build>
@@ -172,34 +181,6 @@
172181
</descriptorRefs>
173182
</configuration>
174183
</execution>
175-
<execution>
176-
<id>without-slf4j</id>
177-
<phase>package</phase>
178-
<goals>
179-
<goal>single</goal>
180-
</goals>
181-
<configuration>
182-
<inlineDescriptors>
183-
<inlineDescriptor>
184-
<id>with-dependencies-exclude-slf4j-simple</id>
185-
<formats>
186-
<format>jar</format>
187-
</formats>
188-
<includeBaseDirectory>false</includeBaseDirectory>
189-
<dependencySets>
190-
<dependencySet>
191-
<outputDirectory>/</outputDirectory>
192-
<useProjectArtifact>true</useProjectArtifact>
193-
<unpack>true</unpack>
194-
<excludes>
195-
<exclude>org.slf4j:slf4j-simple</exclude>
196-
</excludes>
197-
</dependencySet>
198-
</dependencySets>
199-
</inlineDescriptor>
200-
</inlineDescriptors>
201-
</configuration>
202-
</execution>
203184
</executions>
204185
</plugin>
205186
<plugin>
@@ -283,12 +264,9 @@
283264
<buildArg>-H:+ReportExceptionStackTraces</buildArg>
284265
<buildArg>-H:ReflectionConfigurationFiles=../config/reflect-config.json</buildArg>
285266
<buildArg>-H:ResourceConfigurationFiles=../config/resource-config.json</buildArg>
286-
<!-- <buildArg>-H:+StaticExecutableWithDynamicLibC</buildArg> -->
287267
<buildArg>--verbose</buildArg>
288268
<buildArg>--no-fallback</buildArg>
289269
<buildArg>-march=native</buildArg>
290-
<!-- For Quick Build (22.1+) -->
291-
<!-- <buildArg>-Ob</buildArg>-->
292270
</buildArgs>
293271
</configuration>
294272
</plugin>

0 commit comments

Comments
 (0)