Skip to content

Commit

Permalink
Added initial script for maven publishing
Browse files Browse the repository at this point in the history
Needs proper versioning and actual maven urls
  • Loading branch information
ImperatorStorm committed Jan 21, 2023
1 parent 6c580af commit 45047a2
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build/
.vscode/
.idea/
.idea/
server.pom
client.pom
4 changes: 2 additions & 2 deletions jarBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ mkdir build/mappings
if [ $1 == "client" ]
then
cp ./client.tiny build/mappings/
cd build && zip -5 client.jar ./META-INF/MANIFEST.INF ./mappings/client.tiny
cd build && zip -5 client-$(git rev-parse HEAD).jar ./META-INF/MANIFEST.INF ./mappings/client.tiny
elif [ $1 == "server" ]
then
cp ./server.tiny build/mappings
cd build && zip -5 server.jar ./META-INF/MANIFEST.INF ./mappings/server.tiny
cd build && zip -5 server-$(git rev-parse HEAD).jar ./META-INF/MANIFEST.INF ./mappings/server.tiny
else
echo "Please provide what platform you want to export! Valid options are 'client' and 'server'."
exit 1
Expand Down
11 changes: 11 additions & 0 deletions publishMappings.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh
rm -f client*.pom server*.pom
pom_version=$(git rev-parse HEAD)
cp template-mappings.pom client-$pom_version.pom
cp template-mappings.pom server-$pom_version.pom
sed -i 's/template_pom/client/' client-$pom_version.pom
sed -i 's/template_pom/server/' server-$pom_version.pom
sed -i 's/>git</>'$(git rev-parse HEAD)'</' server-$pom_version.pom
sed -i 's/>git</>'$(git rev-parse HEAD)'</' client-$pom_version.pom
mvn gpg:sign-and-deploy-file -Durl=$1 -DrepositoryId=$2 -DpomFile=client-$pom_version.pom -Dfile=build/client-$pom_version.jar
mvn gpg:sign-and-deploy-file -Durl=$1 -DrepositoryId=$2 -DpomFile=server-$pom_version.pom -Dfile=build/server-$pom_version.jar
26 changes: 26 additions & 0 deletions template-mappings.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.duvetmc</groupId>
<artifactId>template_pom</artifactId>
<version>git</version>
<description>POM was created from install:install-file</description>
<licenses>
<license>
<name>CC0-1.0 License</name>
<url>https://creativecommons.org/publicdomain/zero/1.0/legalcode</url>
<license>
</licenses>
<developers>
<developer>
<organization>DuvetMC</organization>
<organizationUrl>https://github.com/duvetmc</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git+https://github.com/DuvetMC/ChaosMappings.git</connection>
<developerConnection>scm:git:ssh://github.com:DuvetMC/ChaosMappings.git</developerConnection>
<url>https://github.com/DuvetMC/ChaosMappings</url>
</scm>
</project>

0 comments on commit 45047a2

Please sign in to comment.