Update deployment script

This commit is contained in:
Alexey Andreev 2023-01-25 16:40:58 +01:00
parent e3da484f79
commit dd0b9f70df
3 changed files with 31 additions and 16 deletions

View File

@ -14,4 +14,10 @@
* limitations under the License.
*/
group = "org.teavm"
plugins {
idea
}
group = "org.teavm"
idea.module.excludeDirs.add(File(rootDir, "build-dir"))

View File

@ -15,7 +15,6 @@
#
mkdir -p build-dir
mkdir -p build-cache/maven-repository
git fetch
git archive master | tar -x -C build-dir || { echo 'Git archive failed' ; exit 1; }
@ -44,14 +43,25 @@ function deploy_teavm {
echo "Building version $TEAVM_DEPLOY_VERSION_FULL"
./gradlew build || { echo 'Build failed' ; return 1; }
./gradlew publishAllPublicationsToMavenRepository || { echo 'Deploy failed' ; return 1; }
GRADLE="./gradlew"
GRADLE+=" --no-daemon --no-configuration-cache"
GRADLE+=" -Pteavm.project.version=$TEAVM_DEPLOY_VERSION_FULL"
GRADLE+=" -Pteavm.publish.url=sftp://$TEAVM_DEPLOY_SERVER/maven/repository"
GRADLE+=" -Pteavm.publish.username=$TEAVM_DEPLOY_LOGIN"
GRADLE+=" -Pteavm.publish.password=$TEAVM_DEPLOY_PASSWORD"
$GRADLE build -x test || { echo 'Build failed' ; return 1; }
$GRADLE publishAllPublicationsToTeavmRepository || { echo 'Deploy failed' ; return 1; }
curl -T tools/idea/build/distributions/idea-$TEAVM_DEPLOY_VERSION_FULL.zip \
sftp://$TEAVM_DEPLOY_SERVER/idea/teavm-idea-$TEAVM_DEPLOY_VERSION_FULL.zip \
--user $TEAVM_DEPLOY_LOGIN:$TEAVM_DEPLOY_PASSWORD
cat <<EOF >idea-repository.xml
<?xml version="1.0" encoding="UTF-8"?>
<plugins>
<plugin id="org.teavm.idea" url="https://teavm.org/maven/repository/org/teavm/teavm-idea/$TEAVM_DEPLOY_VERSION_FULL/teavm-idea-$TEAVM_DEPLOY_VERSION_FULL.zip" version="$TEAVM_DEPLOY_VERSION_FULL">
<idea-version since-build="182.*" until-build="223.*" />
<plugin id="org.teavm.idea" url="https://teavm.org/idea/teavm-idea-$TEAVM_DEPLOY_VERSION_FULL.zip" version="$TEAVM_DEPLOY_VERSION_FULL">
<idea-version since-build="201.*" until-build="232.*" />
<description>TeaVM support</description>
</plugin>
</plugins>
@ -59,7 +69,7 @@ EOF
curl --output badge.svg "https://img.shields.io/static/v1?label=download&message=$TEAVM_DEPLOY_VERSION_FULL&color=green"
cat <<EOF >htaccess
Redirect /maven/_latest /maven/repository/org/teavm/teavm-cli/$TEAVM_DEPLOY_VERSION_FULL/teavm-cli-$TEAVM_DEPLOY_VERSION_FULL.jar
Redirect /maven/_latest /maven/repository/org/teavm/teavm-cli/$TEAVM_DEPLOY_VERSION_FULL/teavm-cli-$TEAVM_DEPLOY_VERSION_FULL-all.jar
EOF
echo "$TEAVM_DEPLOY_BUILD" >build-number.txt
@ -72,23 +82,22 @@ deploy_teavm
EXIT_CODE=$?
if [[ "$EXIT_CODE" == '0' ]] ; then
curl -T build-number.txt \
ftp://$TEAVM_DEPLOY_SERVER/maven/versions/$TEAVM_DEPLOY_VERSION.txt \
sftp://$TEAVM_DEPLOY_SERVER/maven/versions/$TEAVM_DEPLOY_VERSION.txt \
--user $TEAVM_DEPLOY_LOGIN:$TEAVM_DEPLOY_PASSWORD
curl -T commit-id.txt \
ftp://$TEAVM_DEPLOY_SERVER/maven/versions/$TEAVM_DEPLOY_VERSION_FULL-commit.txt \
sftp://$TEAVM_DEPLOY_SERVER/maven/versions/$TEAVM_DEPLOY_VERSION_FULL-commit.txt \
--user $TEAVM_DEPLOY_LOGIN:$TEAVM_DEPLOY_PASSWORD
curl -T badge.svg \
ftp://$TEAVM_DEPLOY_SERVER/maven/badge.svg \
sftp://$TEAVM_DEPLOY_SERVER/maven/badge.svg \
--user $TEAVM_DEPLOY_LOGIN:$TEAVM_DEPLOY_PASSWORD
curl -T htaccess \
ftp://$TEAVM_DEPLOY_SERVER/maven/.htaccess \
sftp://$TEAVM_DEPLOY_SERVER/maven/.htaccess \
--user $TEAVM_DEPLOY_LOGIN:$TEAVM_DEPLOY_PASSWORD
curl -T idea-repository.xml \
ftp://$TEAVM_DEPLOY_SERVER/idea/dev/teavmRepository.xml \
sftp://$TEAVM_DEPLOY_SERVER/idea/dev/teavmRepository.xml \
--user $TEAVM_DEPLOY_LOGIN:$TEAVM_DEPLOY_PASSWORD
fi
popd
rm -rf build-dir
rm -rf build-cache/maven-repository/org/teavm
exit $EXIT_CODE
#rm -rf build-dir
#exit $EXIT_CODE

View File

@ -17,7 +17,7 @@
plugins {
`java-gradle-plugin`
publishing
`maven-publish`
`teavm-publish`
}
dependencies {