Skip to content

Commit

Permalink
Merge pull request #4 from RomualdRousseau/feature/new-doc-system
Browse files Browse the repository at this point in the history
fix: Add workflow for github pages
  • Loading branch information
RomualdRousseau authored Aug 27, 2024
2 parents 2252258 + 5ba9ec1 commit 21c67d6
Show file tree
Hide file tree
Showing 1,217 changed files with 235 additions and 149,144 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/any2json-monorepo-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ on:
types: [published]

jobs:
deploy-prod:
uses: ./.github/workflows/maven-deploy-prod.yml
# deploy-prod:
# uses: ./.github/workflows/maven-deploy-prod.yml
# with:
# version: ${{ github.event.release.tag_name }}
# secrets: inherit

deploy-doc:
needs: [deploy-prod]
uses: ./.github/workflows/maven-deploy-doc.yml
with:
version: ${{ github.event.release.tag_name }}
secrets: inherit


12 changes: 7 additions & 5 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@ jobs:
maven-build:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- uses: actions/cache@v4
- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Installing local dependencies
run: mvn initialize --projects :${{ inputs.service }} --file pom.xml --also-make --batch-mode
run: mvn initialize --projects :${{ inputs.service }} --also-make

- name: Build project
run: mvn -U -B package -Dmaven.test.skip=true --projects :${{ inputs.service }} --file pom.xml --also-make --batch-mode
run: mvn -U -B package -DskipTests --projects :${{ inputs.service }} --also-make

- name: Archive build artifact
uses: actions/upload-artifact@v4
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/maven-deploy-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
workflow_call:
inputs:
version:
required: true
type: string

jobs:
maven-deploy-doc:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Set up MkDocs
run: pip install mkdocs

- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Set version
run: |
mvn versions:set -DnewVersion=${{ inputs.version }}
mvn versions:commit
- name: Build documentation
run: |
mkdocs build --config-file ./any2json-documents/mkdocs.yml --site-dir ./target/docs
mvn -B -P documentation clean site site:stage
- name: Setup pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./target/docs

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
24 changes: 13 additions & 11 deletions .github/workflows/maven-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,40 @@ jobs:
maven-deploy-prod:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- uses: actions/cache@v4
- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Installing local dependencies
run: mvn initialize --file pom.xml --also-make --batch-mode

- name: Set version
run: |
mvn versions:set -DnewVersion=${{ inputs.version }} --file pom.xml --also-make --batch-mode
mvn versions:commit --file pom.xml --also-make --batch-mode
- name: Setup GPG
run: |
echo "$GPG_PRIVATE_KEY" > private.asc
gpg --import --batch private.asc
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Set version
run: |
mvn versions:set -DnewVersion=${{ inputs.version }}
mvn versions:commit
- name: Installing local dependencies
run: mvn -U -B initialize

- name: Deploy project
run: |
export GPG_TTY=$(tty)
mvn -U -B clean deploy -P release --file pom.xml -s .mvn/settings.xml --also-make --batch-mode
mvn -U -B clean deploy -P release -s .mvn/settings.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/maven-deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ jobs:
maven-deploy-snapshot:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- uses: actions/cache@v4
- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Installing local dependencies
run: mvn initialize --file pom.xml --also-make --batch-mode
run: mvn -U -B initialize

- name: Deploy project snapshot
run: mvn -U -B clean deploy -P snapshot --file pom.xml -s .mvn/settings.xml --also-make --batch-mode
run: mvn -U -B clean deploy -P snapshot -s .mvn/settings.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
12 changes: 7 additions & 5 deletions .github/workflows/maven-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ jobs:
maven-test:
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "temurin"

- uses: actions/cache@v4
- name: Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

- name: Installing local dependencies
run: mvn initialize --projects :${{ inputs.service }} --file pom.xml --also-make --batch-mode
run: mvn -U -B initialize --projects :${{ inputs.service }} --also-make

- name: Test project
run: mvn -B test --projects :${{ inputs.service }} --file pom.xml --also-make --batch-mode
run: mvn -U -B test --projects :${{ inputs.service }} --also-make
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Run the following command line:
mvn -P release clean deploy
```

### Build and deploy the javadoc documentation
### Build the javadoc documentation

Run the following command line:

Expand Down
4 changes: 0 additions & 4 deletions any2json-dbf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<description>Convert any text file in Json</description>
<url>https://github.com/romualdrousseau/any2json-dbf</url>

<properties>
<javadbf.version>1.14.1</javadbf.version>
</properties>

<dependencies>
<!-- Any2Json Framework -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion any2json-documents/justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build: copy-pdfs
mkdocs build --site-dir ../docs
mkdocs build --site-dir ../target/docs

serve: copy-pdfs
mkdocs serve
Expand Down
4 changes: 2 additions & 2 deletions any2json-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<plugins>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.2</version>
<version>3.1.3</version>
<executions>
<execution>
<?m2e ignore?>
Expand All @@ -89,7 +89,7 @@
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.1</version>
<version>3.8.0</version>
<executions>
<execution>
<?m2e ignore?>
Expand Down
6 changes: 1 addition & 5 deletions any2json-excel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
<description>Convert any text file in Json</description>
<url>https://github.com/romualdrousseau/any2json-excel</url>

<properties>
<poi.version>5.3.0</poi.version>
</properties>

<dependencies>
<!-- Any2Json Framework -->
<dependency>
Expand Down Expand Up @@ -73,7 +69,7 @@
<plugins>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.2</version>
<version>3.1.3</version>
<executions>
<execution>
<?m2e ignore?>
Expand Down
Loading

0 comments on commit 21c67d6

Please sign in to comment.