Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
Switch to publishing on GitHub Actions (#27)
Browse files Browse the repository at this point in the history
* Switch to publishing on GitHub Actions

* lol this is maven not gradle

* add maven repo to pom

* Fix indentation of steps in Java CI workflow
  • Loading branch information
Konicai authored Sep 21, 2023
1 parent eae1397 commit 7305143
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 38 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy

on:
push:
branches:
- master

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

- name: Set up JDK 1.8
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: 8
distribution: temurin

- uses: s4u/[email protected]
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 }}
18 changes: 11 additions & 7 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn package --file pom.xml
- name: Checkout repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

- name: Set up JDK 1.8
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
with:
java-version: 8
distribution: temurin

- name: Build with Maven
run: mvn package --file pom.xml
30 changes: 0 additions & 30 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
}
}
}
}
27 changes: 26 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.8</jdk.version>
<argLine></argLine>
</properties>

<licenses>
Expand All @@ -38,6 +37,13 @@
<name>Steveice10</name>
<email>[email protected]</email>
</developer>
<developer>
<id>GeyserMC</id>
<name>GeyserMC</name>
<url>https://geysermc.org/</url>
<organization>GeyserMC</organization>
<organizationUrl>https://github.com/GeyserMC</organizationUrl>
</developer>
</developers>

<issueManagement>
Expand Down Expand Up @@ -126,4 +132,23 @@
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>deploy</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<distributionManagement>
<repository>
<id>opencollab-release-repo</id>
<url>https://repo.opencollab.dev/maven-releases/</url>
</repository>
<snapshotRepository>
<id>opencollab-snapshot-repo</id>
<url>https://repo.opencollab.dev/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
</project>

0 comments on commit 7305143

Please sign in to comment.