From 4f5b210448cca264e841aedf7d29622a77759ffa Mon Sep 17 00:00:00 2001 From: Konicai <71294714+konicai@users.noreply.github.com> Date: Thu, 21 Sep 2023 12:39:31 -0400 Subject: [PATCH] Switch to publishing on GitHub Actions --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++++++++++++++ .github/workflows/maven.yml | 13 ++++++++++--- Jenkinsfile | 30 ------------------------------ 3 files changed, 44 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..85822b5 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Deploy + +on: + push: + branches: + - master + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 + + - name: Set up JDK 1.8 + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 + with: + java-version: 8 + distribution: temurin + + - uses: s4u/maven-settings-action@v2.8.0 + with: + servers: '[{"id": "opencollab-release-repo", "username": "${env.MAVEN_USERNAME}", "password": "${env.MAVEN_PASSWORD}"},{"id": "opencollab-snapshot-repo", "username": "${env.MAVEN_USERNAME}", "password": "${env.MAVEN_PASSWORD}"}]' + + - name: Deploy with Maven + run: mvn deploy -B -P deploy + env: + MAVEN_USERNAME: ${{ vars.DEPLOY_USER }} + MAVEN_PASSWORD: ${{ secrets.DEPLOY_PASS }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 73ac252..5616981 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -8,10 +8,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: Checkout repository + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 + - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 with: - java-version: 1.8 + java-version: 8 + distribution: temurin + - name: Build with Maven run: mvn package --file pom.xml diff --git a/Jenkinsfile b/Jenkinsfile index c3093b7..e000a95 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,35 +18,5 @@ pipeline { } } } - - stage ('Deploy') { - when { - branch "master" - } - - steps { - rtMavenDeployer( - id: "maven-deployer", - serverId: "opencollab-artifactory", - releaseRepo: "maven-releases", - snapshotRepo: "maven-snapshots" - ) - rtMavenResolver( - id: "maven-resolver", - serverId: "opencollab-artifactory", - releaseRepo: "maven-deploy-release", - snapshotRepo: "maven-deploy-snapshot" - ) - rtMavenRun( - pom: 'pom.xml', - goals: 'javadoc:jar source:jar install -DskipTests', - deployerId: "maven-deployer", - resolverId: "maven-resolver" - ) - rtPublishBuildInfo( - serverId: "opencollab-artifactory" - ) - } - } } } \ No newline at end of file