File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717 runs-on : ubuntu-latest
1818 permissions :
19- contents : read
19+ contents : write
2020 packages : write
2121
2222 steps :
3838 name : test-results
3939 path : target/surefire-reports/
4040
41+ - name : Upload Binary Distribution
42+ if : github.event_name == 'release'
43+ env :
44+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+ run : gh release upload "${{ github.event.release.tag_name }}" target/mallet-*-bin.zip
46+
4147 - name : Publish to GitHub Packages using Apache Maven
4248 if : github.event_name == 'release'
4349 run : mvn --batch-mode deploy -P publish-on-github-packages -DskipTests
Original file line number Diff line number Diff line change 44malletdir=` dirname $0 `
55malletdir=` dirname $malletdir `
66
7- cp=$malletdir /target/classes:$malletdir /target/dependency/* :$CLASSPATH
8- # echo $cp
7+ # Support both source build (target/) and binary distribution (lib/)
8+ if [ -d " $malletdir /target/classes" ]; then
9+ cp=$malletdir /target/classes:$malletdir /target/dependency/* :$CLASSPATH
10+ else
11+ cp=$malletdir /lib/* :$CLASSPATH
12+ fi
913
1014MEMORY=" ${MALLET_MEMORY:- 1g} "
1115
1519help ()
1620{
1721cat << EOF
18- Mallet 2.0 commands:
22+ Mallet 2.1. 0 commands:
1923
2024 import-dir load the contents of a directory into mallet instances (one per file)
2125 import-file load a single file into mallet instances (one per line)
Original file line number Diff line number Diff line change @@ -10,7 +10,12 @@ goto :eof
1010
1111:gotMalletHome
1212
13- set MALLET_CLASSPATH = %MALLET_HOME% \target\classes;%MALLET_HOME% \target\dependency\*
13+ rem Support both source build (target\) and binary distribution (lib\)
14+ if exist " %MALLET_HOME% \target\classes" (
15+ set MALLET_CLASSPATH = %MALLET_HOME% \target\classes;%MALLET_HOME% \target\dependency\*
16+ ) else (
17+ set MALLET_CLASSPATH = %MALLET_HOME% \lib\*
18+ )
1419set MALLET_MEMORY = 1G
1520set MALLET_ENCODING = UTF-8
1621
@@ -36,7 +41,7 @@ if "%CMD%"=="run" set CLASS=%1 & shift
3641
3742if not " %CLASS% " == " " goto gotClass
3843
39- echo Mallet 2.0 commands:
44+ echo Mallet 2.1. 0 commands:
4045echo import-dir load the contents of a directory into mallet instances (one per file)
4146echo import-file load a single file into mallet instances (one per line)
4247echo import-svmlight load a single SVMLight format data file into mallet instances (one per line)
Original file line number Diff line number Diff line change 184184 </executions >
185185 </plugin >
186186
187+ <!-- Binary distribution ZIP -->
188+ <plugin >
189+ <groupId >org.apache.maven.plugins</groupId >
190+ <artifactId >maven-assembly-plugin</artifactId >
191+ <version >3.7.1</version >
192+ <configuration >
193+ <descriptors >
194+ <descriptor >src/main/assembly/bin.xml</descriptor >
195+ </descriptors >
196+ <finalName >mallet-${project.version} </finalName >
197+ </configuration >
198+ <executions >
199+ <execution >
200+ <id >make-assembly</id >
201+ <phase >package</phase >
202+ <goals >
203+ <goal >single</goal >
204+ </goals >
205+ </execution >
206+ </executions >
207+ </plugin >
208+
187209 <!-- Unit tests -->
188210 <plugin >
189211 <groupId >org.apache.maven.plugins</groupId >
Original file line number Diff line number Diff line change 1+ <assembly xmlns =" http://maven.apache.org/ASSEMBLY/2.2.0"
2+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : schemaLocation =" http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd" >
4+
5+ <id >bin</id >
6+ <formats >
7+ <format >zip</format >
8+ </formats >
9+
10+ <includeBaseDirectory >true</includeBaseDirectory >
11+
12+ <!-- Include the main JAR and runtime dependencies in lib/ -->
13+ <dependencySets >
14+ <dependencySet >
15+ <outputDirectory >lib</outputDirectory >
16+ <useProjectArtifact >true</useProjectArtifact >
17+ <scope >runtime</scope >
18+ </dependencySet >
19+ </dependencySets >
20+
21+ <fileSets >
22+ <!-- bin/ scripts (with executable permission) -->
23+ <fileSet >
24+ <directory >bin</directory >
25+ <outputDirectory >bin</outputDirectory >
26+ <includes >
27+ <include >mallet</include >
28+ <include >mallet.bat</include >
29+ </includes >
30+ <fileMode >0755</fileMode >
31+ </fileSet >
32+
33+ <!-- Sample data for getting started -->
34+ <fileSet >
35+ <directory >sample-data</directory >
36+ <outputDirectory >sample-data</outputDirectory >
37+ </fileSet >
38+
39+ <!-- Stoplists -->
40+ <fileSet >
41+ <directory >stoplists</directory >
42+ <outputDirectory >stoplists</outputDirectory >
43+ </fileSet >
44+
45+ <!-- Top-level files -->
46+ <fileSet >
47+ <directory >.</directory >
48+ <outputDirectory >.</outputDirectory >
49+ <includes >
50+ <include >LICENSE</include >
51+ <include >README.md</include >
52+ <include >CHANGELOG.md</include >
53+ </includes >
54+ </fileSet >
55+ </fileSets >
56+
57+ </assembly >
You can’t perform that action at this time.
0 commit comments