Skip to content

Commit

Permalink
Merge pull request #1 from netgrif/fix
Browse files Browse the repository at this point in the history
Change Gradle to Maven
  • Loading branch information
machacjozef authored Jan 18, 2024
2 parents ef6a649 + 2561afb commit 0f50517
Show file tree
Hide file tree
Showing 87 changed files with 1,617 additions and 857 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Pull Request
on:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build
run: mvn clean verify -DskipTests=true

test:
name: Test
needs: build
runs-on: ubuntu-latest
timeout-minutes: 200
services:
mongo:
image: mongo:4.4
ports:
- 27017:27017
steps:

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build
run: mvn clean package install -DskipTests=true

- name: Build, test
timeout-minutes: 180
run: mvn -B test
21 changes: 0 additions & 21 deletions .github/workflows/publish.yml

This file was deleted.

108 changes: 108 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Publish package to GitHub Packages
on:
release:
types: [ published ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
services:
mongo:
image: mongo:4.4
ports:
- 27017:27017
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- uses: cardinalby/git-get-release-action@v1
id: getEnvRelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get Project Version from pom.xml
uses: entimaniac/[email protected]
id: getVersion

# - name: Check Enviroment release
# if: ${{ !((steps.getEnvRelease.outputs.prerelease && contains(steps.getVersion.outputs.version, '-SNAPSHOT')) || (!steps.getEnvRelease.outputs.prerelease && !contains(steps.getVersion.outputs.version, '-SNAPSHOT'))) }}
# run: exit 1

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build
run: mvn clean verify

publish-OSSRH:
runs-on: ubuntu-latest
name: Publish to Maven Central
needs: test
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
- name: Set up Maven Central Repository
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Publish package
run: mvn -DskipTests=true --batch-mode -P ossrh-publish -Dgpg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

publish-artifact:
name: GitHub Artifacts
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'

- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Publish artifact on GitHub Packages
run: mvn -B -P github-publish clean deploy -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 38 additions & 6 deletions .gitignore
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
/build
/.gradle
/.settings
/.classpath
/.project
/.idea
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### IntelliJ IDEA ###
.idea/
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
/out
lib/*
*#
Expand All @@ -13,3 +20,28 @@ lib/*
src/legacytest/*
checkouts/*
bin

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

29 changes: 0 additions & 29 deletions CONTRIBUTING.md

This file was deleted.

Loading

0 comments on commit 0f50517

Please sign in to comment.