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

View File

@ -1,18 +1,28 @@
#!/bin/bash -e #!/bin/bash -e
set -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 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>/' {} \; 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 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 remote add origin "ssh://git@ssh.git.ignuranza.net/tdlight-team/tdlight-docs"
git config user.email "andrea@warp.ovh" git config user.email "andrea@warp.ovh"
git config user.name "Andrea Cavalli" git config user.name "Andrea Cavalli"
git fetch --all git fetch --all
git reset --soft "origin/${IMPLEMENTATION_NAME}" git reset --soft "origin/${IMPLEMENTATION_NAME}-${API_TYPE}"
git add -A git add -A
git commit -m "Update javadocs" git commit -m "Update javadocs"
git push --set-upstream origin "${IMPLEMENTATION_NAME}" git push --set-upstream origin "${IMPLEMENTATION_NAME}-${API_TYPE}"
echo "Done." echo "Done."
exit 0 exit 0

View File

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

View File

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

View File

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