This commit is contained in:
Andrea Cavalli 2021-12-08 00:17:22 +01:00
parent bac39f6e9a
commit 757fdfe19b
5 changed files with 42 additions and 20 deletions

View File

@ -111,7 +111,8 @@ jobs:
run: |
echo "REVISION: $REVISION"
./scripts/continuous-integration/github-workflows/deploy-snapshot.sh
API_TYPE=legacy ./scripts/continuous-integration/github-workflows/deploy-snapshot.sh
API_TYPE=sealed ./scripts/continuous-integration/github-workflows/deploy-snapshot.sh
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}
@ -121,8 +122,10 @@ jobs:
run: |
echo "REVISION: $REVISION"
./scripts/continuous-integration/github-workflows/deploy-release.sh
./scripts/continuous-integration/github-workflows/deploy-javadoc.sh
API_TYPE=legacy ./scripts/continuous-integration/github-workflows/deploy-release.sh
API_TYPE=sealed ./scripts/continuous-integration/github-workflows/deploy-release.sh
API_TYPE=legacy ./scripts/continuous-integration/github-workflows/deploy-javadoc.sh
API_TYPE=sealed ./scripts/continuous-integration/github-workflows/deploy-javadoc.sh
env:
MAVEN_USERNAME: ${{ secrets.MCHV_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MCHV_TOKEN }}

View File

@ -1,18 +1,28 @@
#!/bin/bash -e
set -e
# Check variables correctness
if [ -z "${IMPLEMENTATION_NAME}" ]; then
echo "Missing parameter: IMPLEMENTATION_NAME"
exit 1
fi
if [ -z "${API_TYPE}" ]; then
echo "Missing parameter: API_TYPE"
exit 1
fi
cd ./generated/target/apidocs
find . -name '*.html' -exec sed -i -r 's/<\/title>/<\/title>\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><style>\n\t#memberSummary_tabpanel{overflow-x: auto;}\n\tli.blockList{overflow-x: auto;}\n\ttd.colLast div{max-width:30vw;}\n\t#search{width: 400px;max-width: 65vw;}\n\t.title,.subTitle,pre,.inheritance,h1,h2,h3,h4,h5,.memberSummary,.memberSignature,.typeSummary,.blockList,.contentContainer{white-space:normal;word-break:break-word;}\n\tul{padding-left:10px}\n<\/style>/' {} \;
git init
git checkout -b "${IMPLEMENTATION_NAME}"
git checkout -b "${IMPLEMENTATION_NAME}-${API_TYPE}"
git remote add origin "ssh://git@ssh.git.ignuranza.net/tdlight-team/tdlight-docs"
git config user.email "andrea@warp.ovh"
git config user.name "Andrea Cavalli"
git fetch --all
git reset --soft "origin/${IMPLEMENTATION_NAME}"
git reset --soft "origin/${IMPLEMENTATION_NAME}-${API_TYPE}"
git add -A
git commit -m "Update javadocs"
git push --set-upstream origin "${IMPLEMENTATION_NAME}"
git push --set-upstream origin "${IMPLEMENTATION_NAME}-${API_TYPE}"
echo "Done."
exit 0

View File

@ -1,6 +1,8 @@
#!/bin/bash -e
# OTHER REQUIRED ENVIRONMENT VARIABLES:
# REVISION = <revision>
# OTHER ENVIRONMENT VARIABLES:
# API_TYPE = <legacy|sealed>
# Check variables correctness
if [ -z "${REVISION}" ]; then
@ -9,10 +11,11 @@ if [ -z "${REVISION}" ]; then
fi
source ./setup-variables.sh
FALLBACK_API_TYPE="sealed"
cd ../../generated
mvn -B -DrevisionNumber="${REVISION}" -DrevisionSuffix="" clean deploy
mvn -B -DrevisionNumber="${REVISION}" "-D${API_TYPE:-${FALLBACK_API_TYPE}}" -DrevisionSuffix="" clean deploy
echo "Done."
exit 0

View File

@ -1,7 +1,12 @@
#!/bin/bash -e
# OTHER ENVIRONMENT VARIABLES:
# API_TYPE = <legacy|sealed>
cd ../../generated
mvn -B deploy
FALLBACK_API_TYPE="sealed"
mvn -B "-D${API_TYPE:-${FALLBACK_API_TYPE}}" deploy
echo "Done."
exit 0

View File

@ -117,7 +117,8 @@
<version>3.8.1</version>
<configuration>
<encoding>UTF-8</encoding>
<release>17</release>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
@ -186,15 +187,22 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.1.0</version>
<version>1.2.2</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>resolveCiFriendliesOnly</flattenMode>
</configuration>
<executions>
<!-- enable flattening -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
@ -202,6 +210,7 @@
<goal>flatten</goal>
</goals>
</execution>
<!-- ensure proper cleanup -->
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
@ -211,14 +220,6 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>
</project>