Fix deployment

This commit is contained in:
Andrea Cavalli 2023-05-09 11:46:30 +02:00
parent 8098add2ae
commit ed16207b37
2 changed files with 38 additions and 34 deletions

View File

@ -49,7 +49,7 @@ jobs:
TYPE=${{ matrix.type }}
SAFE_TYPE=${TYPE///} # linux-amd64 -> linux-amd64
REVISION=${{ github.run_number }}
REVISION=4.0.${{ github.run_number }}
GH_MATRIX_OS=${{ matrix.os }}
GH_MATRIX_TYPE=${{ matrix.type }}
@ -180,8 +180,8 @@ jobs:
source ./.github/workflows/scripts/build-${SAFE_TYPE}.sh
- uses: actions/upload-artifact@v3
with:
name: natives/target/tdlight-natives-${{env.REVISION}}.jar
path: natives/target/tdlight-natives-${{env.REVISION}}.jar
name: natives/target-${{env.TYPE}}/tdlight-natives-${{env.REVISION}}-${{env.TYPE}}.jar
path: natives/target-${{env.TYPE}}/tdlight-natives-${{env.REVISION}}-${{env.TYPE}}.jar
- name: Deploy to Maven (Snapshot)
if: github.ref == 'refs/heads/develop'
shell: bash
@ -189,8 +189,17 @@ jobs:
set -eo pipefail
echo "REVISION: $REVISION"
echo "TYPE: $TYPE"
mvn -B -f natives/pom.xml -Drevision="$REVISION" -Dnative.type.classifier="$TYPE" clean package deploy
if [[ "$TYPE" == "linux-amd64-ssl1"]]; then
mvn -B -f natives/pom.xml -Drevision="$REVISION" -Dnative.type.classifier="$TYPE" clean package deploy
else
mvn -B -f natives/pom.xml -Drevision="$REVISION" -Dnative.type.classifier="$TYPE" clean package
mvn org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file -Durl=https://mvn.mchv.eu/repository/mchv \
-DrepositoryId=mchv-release-distribution \
-Dfile=natives/target-$TYPE/tdlight-natives-$REVISION-$TYPE.jar \
-DpomFile=natives/pom.xml \
-Dclassifier=bin \
-Drevision="$REVISION"
fi
echo "Done."
exit 0
@ -204,8 +213,17 @@ jobs:
set -eo pipefail
echo "REVISION: $REVISION"
echo "TYPE: $TYPE"
mvn -B -f natives/pom.xml -Drevision="$REVISION" -Dnative.type.classifier="$TYPE" clean package deploy
if [[ "$TYPE" == "linux-amd64-ssl1"]]; then
mvn -B -f natives/pom.xml -Drevision="$REVISION" -Dnative.type.classifier="$TYPE" clean package deploy
else
mvn -B -f natives/pom.xml -Drevision="$REVISION" -Dnative.type.classifier="$TYPE" clean package
mvn org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file -Durl=https://mvn.mchv.eu/repository/mchv \
-DrepositoryId=mchv-release-distribution \
-Dfile=natives/target-$TYPE/tdlight-natives-$REVISION-$TYPE.jar \
-DpomFile=natives/pom.xml \
-Dclassifier=bin \
-Drevision="$REVISION"
fi
echo "Done."
exit 0

View File

@ -1,7 +1,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it.tdlight</groupId>
<artifactId>TDLight-natives</artifactId>
<artifactId>tdlight-natives</artifactId>
<!-- Don't change the version! (or change it also in <shadedPattern>) -->
<version>${revision}</version>
<name>tdlight natives</name>
@ -10,6 +10,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<revision>4.0.0-SNAPSHOT</revision>
<native.type.classifier>_invalid_</native.type.classifier>
<buildDirectory>${project.basedir}/target-${native.type.classifier}</buildDirectory>
</properties>
<distributionManagement>
<repository>
@ -30,6 +31,7 @@
<tag>HEAD</tag>
</scm>
<build>
<directory>${buildDirectory}</directory>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
@ -73,37 +75,21 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.1.1</version>
<configuration>
<allowIncompleteProjects>true</allowIncompleteProjects>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<version>3.1.1</version>
<configuration>
<allowIncompleteProjects>true</allowIncompleteProjects>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>ssl3</id>
<activation>
<property>
<name>ssl3</name>
<value>True</value>
</property>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<classifier>${native.type.classifier}-ssl3</classifier>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>