Skip to content

Commit

Permalink
Merge pull request #7 from abzif/main-dev
Browse files Browse the repository at this point in the history
Drop history gh-pages
  • Loading branch information
abzif authored Jan 10, 2025
2 parents b302cd7 + 803d9df commit d1e5aee
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 68 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/maven-dry-run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: maven-dry-run
on:
push:
branches:
- main
jobs:
maven-dry-run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
server-id: github
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-repo-${{ hashFiles('**/pom.xml') }}-dry-run
restore-keys: maven-repo-
- uses: actions/cache@v4
with:
path: ~/.cache/opennlp-model-generator
key: opennlp-model-cache-${{ github.run_id }}
restore-keys: opennlp-model-cache-
- run: mvn clean install
- run: mvn -Dlanguage.codes=el site
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/site
branch: gh-pages
git-config-name: abzif
git-config-email: abzif@users.noreply.github.com
commit-message: 'Site publish'
single-commit: true
dry-run: true
21 changes: 0 additions & 21 deletions .github/workflows/maven-install.yml

This file was deleted.

14 changes: 9 additions & 5 deletions .github/workflows/maven-site-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ jobs:
key: opennlp-model-cache-${{ github.run_id }}
restore-keys: opennlp-model-cache-
- run: mvn clean install
- run: git config --global user.name "abzif"
- run: git config --global user.email "abzif@users.noreply.github.com"
- run: mvn site-deploy
env:
GITHUB_TOKEN: ${{ github.token }}
- run: mvn site
- uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/site
branch: gh-pages
git-config-name: abzif
git-config-email: abzif@users.noreply.github.com
commit-message: 'Site publish'
single-commit: true
27 changes: 6 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
<generateReports>false</generateReports>
<maven.site.deploy.skip>true</maven.site.deploy.skip>
<max.exec.minutes>0</max.exec.minutes>
<language.codes>cs,da,de,el,en,es,fi,fr,he,it,ja,ko,no,pl,pt,ru,sv,uk,zh</language.codes>
</properties>

<build>
<plugins>
<!-- build-in maven plugins, set explicit version, or they may fail in github workflows -->
<!-- build-in maven plugins, set explicit versions -->
<!-- 'setup-java' github action configures outdated plugin versions and maven build fails in workflow -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -130,6 +132,7 @@
<outputDirectory>${project.build.directory}/jacoco</outputDirectory>
</configuration>
</plugin>
<!-- build fat jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -151,6 +154,7 @@
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</plugin>
<!-- run model generation -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand All @@ -165,6 +169,7 @@
<argument>-J-Dwork.dir=${user.home}/.cache/opennlp-model-generator</argument>
<argument>-J-Dsite.dir=${project.build.directory}/generated-site</argument>
<argument>-J-Dmax.exec.minutes=${max.exec.minutes}</argument>
<argument>-J-Dlanguage.codes=${language.codes}</argument>
<argument>${project.basedir}/src/site/generate-models.jsh</argument>
</arguments>
</configuration>
Expand All @@ -177,26 +182,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<content>${project.build.directory}/site</content>
<siteOutputEncoding>${project.build.sourceEncoding}</siteOutputEncoding>
<serverId>github</serverId>
<scmBranch>gh-pages</scmBranch>
<checkinComment>Site publish</checkinComment>
</configuration>
<executions>
<execution>
<phase>site-deploy</phase>
<goals>
<goal>publish-scm</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
22 changes: 1 addition & 21 deletions src/site/generate-models.jsh
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
import java.time.*;
import java.util.concurrent.*;

List<String> languageCodes = List.of(
"cs", // czech
"da", // danish
"de", // german
"el", // greek
"en", // english
"es", // spanish
"fi", // finnish
"fr", // french
"he", // hebrew
"it", // italian
"ja", // japanese
"ko", // korean
"no", // norwegian
"pl", // polish
"pt", // portugal
"ru", // russian
"sv", // swedish
"uk", // ukrainian
"zh"); // chinese

List<String> modelMarkdownLines = new ArrayList<>();
modelMarkdownLines.add("# Pre-trained models");
Expand All @@ -32,7 +12,7 @@ String toolsJar = System.getProperty("tools.jar", "");
Path workDirectory = Path.of(System.getProperty("work.dir", "."));
Path siteDirectory = Path.of(System.getProperty("site.dir", "."));
Integer maxExecMinutes = Integer.parseInt(System.getProperty("max.exec.minutes", "0"));

List<String> languageCodes = List.of(System.getProperty("language.codes", "").split(","));


String getResourceDirectoryName(String languageCode, String normalizerType) {
Expand Down

0 comments on commit d1e5aee

Please sign in to comment.