Merge branch 'main' of https://github.com/openviglet/turing #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
# This workflow uses actions that GitHub does not certify. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
attestations: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Use Node.js 18.10.0 | |
uses: actions/setup-node@v5 | |
with: | |
node-version: 18.10.0 | |
registry-url: "https://registry.npmjs.org" | |
scope: "@viglet" | |
- name: Install Angular Cli | |
run: npm i -g @angular/cli | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v5 | |
with: | |
java-version: "21" | |
distribution: "temurin" | |
cache: maven | |
- name: Import GPG key | |
run: | | |
echo "$GPG_PRIVATE_KEY" > private.key | |
gpg --batch --import private.key | |
gpg --list-secret-keys | |
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Cache Maven packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Increment Version | |
run: | | |
mvn build-helper:parse-version versions:set -Dgpg.skip=true -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} versions:commit | |
cd turing-js-sdk/js-sdk-lib | |
npm version patch | |
npm run build | |
git config user.name alexandre.oliveira | |
git config user.email alexandre.oliveira@gmail.com | |
git commit -m "Updated version in pom.xml" -a | |
git push | |
- name: Configure Maven Settings | |
uses: s4u/maven-settings-action@v3.0.0 | |
with: | |
servers: | | |
[{ | |
"id": "central", | |
"username": "${{ secrets.OSSRH_USERNAME }}", | |
"password": "${{ secrets.OSSRH_TOKEN }}" | |
}] | |
- name: Publish package | |
run: | | |
mvn --batch-mode -pl turing-commons,turing-java-sdk,turing-aem-commons -P release -am deploy -DskipTests -Dturing.open-browser=false | |
# cd turing-js-sdk/js-sdk-lib | |
# npm publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Deploy Version | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
mvn install package -Dgpg.skip=true -Dturing.open-browser=false | |
export TAG_NAME=v$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
gh release create ${TAG_NAME} --generate-notes | |
gh release upload ${TAG_NAME} turing-aem/aem-plugin/target/aem-plugin.jar --clobber | |
gh release upload ${TAG_NAME} turing-app/target/viglet-turing.jar --clobber | |
gh release upload ${TAG_NAME} turing-connector/connector-app/target/turing-connector.jar --clobber | |
gh release upload ${TAG_NAME} turing-db/db-app/target/turing-db.jar --clobber | |
gh release upload ${TAG_NAME} turing-filesystem/fs-connector/target/turing-filesystem.jar --clobber | |
gh release upload ${TAG_NAME} turing-web-crawler/wc-plugin/target/web-crawler-plugin.jar --clobber | |
gh release upload ${TAG_NAME} turing-java-sdk/target/turing-java-sdk.jar --clobber | |
gh release upload ${TAG_NAME} turing-commons/target/turing-commons.jar --clobber | |
gh release upload ${TAG_NAME} turing-utils/target/turing-utils.zip --clobber | |
- name: Deploy JavaDoc 🚀 | |
uses: MathieuSoysal/Javadoc-publisher.yml@v3.0.2 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
javadoc-branch: javadoc | |
java-version: 21 | |
target-folder: docs/latest/javadoc | |
javadoc-source-folder: target/reports/apidocs |