diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml new file mode 100644 index 0000000..79e7314 --- /dev/null +++ b/.github/workflows/maven-build.yml @@ -0,0 +1,39 @@ +name: Build and Publish + +on: + workflow_dispatch: + push: + branches: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Java 8 + uses: actions/setup-java@v3 + with: + java-version: 8 + + - name: Setup maven repo + uses: s4u/maven-settings-action@v2.6.0 + with: + servers: | + [{ + "id": "waterdog-snapshots", + "username": "${{ secrets.DEPLOY_USERNAME }}", + "password": "${{ secrets.DEPLOY_PASSWORD }}" + }] + + - name: Build + if: ${{ github.ref != 'refs/heads/master' }} + run: mvn -B clean package + shell: bash + + - name: Build and Deploy + if: ${{ github.ref == 'refs/heads/master' }} + run: mvn -B clean package deploy + shell: bash \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 061814f..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,43 +0,0 @@ -pipeline { - agent any - tools { - maven 'Maven 3' - jdk 'Java 11' - } - options { - buildDiscarder(logRotator(artifactNumToKeepStr: '15')) - } - stages { - stage ('Build') { - steps { - withMaven(options: [pipelineGraphPublisher(lifecycleThreshold: 'install')]) { - sh 'mvn clean install' - } - } - } - - stage('Snapshot') { - when { - branch "develop" - } - steps { - sh 'mvn source:jar deploy -DskipTests' - } - } - - stage ('Release') { - when { - branch "master" - } - steps { - sh 'mvn javadoc:jar source:jar deploy -DskipTests' - } - } - - } - post { - always { - deleteDir() - } - } -} \ No newline at end of file diff --git a/pom.xml b/pom.xml index 1fd40f1..9b8c1f8 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ waterdog - https://repo.waterdog.dev/artifactory/main + https://repo.waterdog.dev/main @@ -34,12 +34,12 @@ central waterdog-releases - http://repo.waterdog.dev/artifactory/releases + https://repo.waterdog.dev/releases snapshots waterdog-snapshots - http://repo.waterdog.dev/artifactory/snapshots + https://repo.waterdog.dev/snapshots