From f3f3ce8d99e8a51d31619d3754fd2d367e97ec72 Mon Sep 17 00:00:00 2001 From: "Matteo Franci a.k.a. Fugerit" Date: Wed, 23 Oct 2024 11:25:39 +0200 Subject: [PATCH] Added build and deploy scripts --- .github/workflows/build_maven_package.yml | 32 ++++++++++++++++++ .github/workflows/deploy_maven_package.yml | 38 ++++++++++++++++++++++ CHANGELOG.md | 1 + 3 files changed, 71 insertions(+) create mode 100644 .github/workflows/build_maven_package.yml create mode 100644 .github/workflows/deploy_maven_package.yml diff --git a/.github/workflows/build_maven_package.yml b/.github/workflows/build_maven_package.yml new file mode 100644 index 0000000..cb7eb12 --- /dev/null +++ b/.github/workflows/build_maven_package.yml @@ -0,0 +1,32 @@ +# CI with maven build and scan +# +# version 1.1.0 +# +# see : https://universe.fugerit.org/src/docs/conventions/workflows/build_maven_package.html + +name: CI maven build and scan + +on: + # Trigger analysis when pushing in master or pull requests, and when creating + # a pull request. + push: + branches: + - main + - develop + - branch-preview + pull_request: + types: + - opened + - synchronize + - reopened + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: fugerit-org/psychic-actions/maven-build-scan@stable + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + sonar-token: ${{ secrets.SONAR_TOKEN }} + disable-maven-dependency-submission: ${{ vars.DISABLE_MAVEN_DEPENDENCY_SUBMISSION }} \ No newline at end of file diff --git a/.github/workflows/deploy_maven_package.yml b/.github/workflows/deploy_maven_package.yml new file mode 100644 index 0000000..bff582c --- /dev/null +++ b/.github/workflows/deploy_maven_package.yml @@ -0,0 +1,38 @@ +# CI deploy maven package +# +# version 1.0.0 +# +# see : https://universe.fugerit.org/src/docs/conventions/workflows/deploy_maven_package.html + +name: CI deploy maven package + +on: + push: + branches: + - branch-deploy + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@main + - name: Set up JDK 17 + uses: actions/setup-java@main + with: + java-version: '17' + distribution: 'corretto' + cache: maven + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Import gpg + run: echo -e "${{ secrets.PASSPHRASE }}" | echo -e "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --allow-secret-key-import --import + - name: Build package + run: mvn clean install -P full,coverage,metadata + - name: Publish package + run: mvn --batch-mode deploy -P doRelease + env: + MAVEN_USERNAME: ${{ secrets.OSS_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSS_PASSWORD }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 53e5c1e..fc59dd7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,4 +9,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- build and deploy scripts - EvalKts interface