Fix deployment options

This commit is contained in:
Andrea Cavalli 2023-05-09 10:43:04 +02:00
parent 6fd1c60b17
commit 70fb534cdc
2 changed files with 29 additions and 19 deletions

View File

@ -187,20 +187,10 @@ jobs:
echo "REVISION: $REVISION"
source ./.github/workflows/scripts/build-${SAFE_TYPE}.sh
- id: getfilename
shell: bash
run: |
set -eo pipefail
echo "::set-output name=file::$(cd generated/target; ls tdli*-natives-*.jar)"
- id: getfilepath
shell: bash
run: |
set -eo pipefail
echo "::set-output name=file::$(ls generated/target/tdli*-natives-*.jar)"
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.getfilename.outputs.file }}
path: ${{ steps.getfilepath.outputs.file }}
name: natives/target/tdlight-natives-${{env.REVISION}}.jar
path: natives/target/tdlight-natives-${{env.REVISION}}.jar
- name: Deploy to Maven (Snapshot)
if: github.ref == 'refs/heads/develop'
shell: bash

View File

@ -72,6 +72,14 @@ jobs:
echo "REVISION: $REVISION"
./.github/workflows/scripts/build-api.sh
- uses: actions/upload-artifact@v3
with:
name: tdlight-api-${{env.REVISION}}.jar
path: api/target/tdlight-api-${{env.REVISION}}.jar
- uses: actions/upload-artifact@v3
with:
name: tdlight-api-${{env.REVISION}}-legacy.jar
path: api/target/tdlight-api-${{env.REVISION}}-legacy.jar
- name: Deploy to Maven (Snapshot)
if: github.ref != 'refs/heads/master'
shell: bash
@ -79,10 +87,16 @@ jobs:
set -eo pipefail
echo "REVISION: $REVISION"
echo "Deploying legacy package"
mvn -f api/pom.xml package deploy -Dlegacy=true -Drevision="-1.0.0.0-SNAPSHOT"
echo "Building standard package"
mvn -f api/pom.xml package deploy -Drevision="-1.0.0.0-SNAPSHOT"
mvn -f api/pom.xml clean package deploy -Drevision="1.0.0.0-SNAPSHOT"
echo "Deploying legacy package"
mvn -f api/pom.xml clean package -Dlegacy=true -Drevision="1.0.0.0-SNAPSHOT"
mvn org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy-file -Durl=https://mvn.mchv.eu/repository/mchv-snapshot \
-DrepositoryId=mchv-snapshot-distribution \
-Dfile=api/target/tdlight-api-$REVISION-legacy.jar \
-DpomFile=api/pom.xml \
-Dclassifier=bin \
-Drevision="1.0.0.0-SNAPSHOT"
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}
@ -93,11 +107,17 @@ jobs:
set -eo pipefail
echo "REVISION: $REVISION"
echo "Deploying legacy package"
mvn -f api/pom.xml package deploy -Dlegacy=true -Drevision="$REVISION"
echo "Deploying standard package"
mvn -f api/pom.xml package deploy -Drevision="$REVISION"
mvn -f api/pom.xml clean package deploy -Drevision="$REVISION"
echo "Deploying legacy package"
mvn -f api/pom.xml clean package -Dlegacy=true -Drevision="$REVISION"
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=api/target/tdlight-api-$REVISION-legacy.jar \
-DpomFile=api/pom.xml \
-Dclassifier=bin \
-Drevision="$REVISION"
echo "Deploying docs"