mirror of
https://github.com/vacp2p/linea-besu.git
synced 2026-01-09 15:37:54 -05:00
Upload distributions to Cloudsmith (#15)
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
This commit is contained in:
13
.github/workflows/workflow.yaml
vendored
13
.github/workflows/workflow.yaml
vendored
@@ -58,11 +58,14 @@ jobs:
|
|||||||
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
|
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
|
||||||
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
|
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
|
||||||
|
|
||||||
- name: Store distribution artifacts
|
- name: Publish distribution artifacts
|
||||||
uses: actions/upload-artifact@v3
|
run: |
|
||||||
with:
|
sudo apt update
|
||||||
name: distributions
|
sudo apt install -y python3 python3-pip python3-venv
|
||||||
path: build/distributions
|
./gradlew cloudsmithUpload
|
||||||
|
env:
|
||||||
|
CLOUDSMITH_USER: ${{ secrets.CLOUDSMITH_USER }}
|
||||||
|
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
|
||||||
|
|
||||||
- name: Check Dockerfile syntax
|
- name: Check Dockerfile syntax
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
22
build.gradle
22
build.gradle
@@ -590,6 +590,7 @@ distTar {
|
|||||||
}
|
}
|
||||||
compression = Compression.GZIP
|
compression = Compression.GZIP
|
||||||
archiveExtension = 'tar.gz'
|
archiveExtension = 'tar.gz'
|
||||||
|
archiveBaseName = 'linea-besu'
|
||||||
}
|
}
|
||||||
|
|
||||||
distZip {
|
distZip {
|
||||||
@@ -597,6 +598,7 @@ distZip {
|
|||||||
doFirst {
|
doFirst {
|
||||||
delete fileTree(dir: 'build/distributions', include: '*.zip')
|
delete fileTree(dir: 'build/distributions', include: '*.zip')
|
||||||
}
|
}
|
||||||
|
archiveBaseName = 'linea-besu'
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
@@ -604,9 +606,9 @@ publishing {
|
|||||||
distArtifactory(MavenPublication) {
|
distArtifactory(MavenPublication) {
|
||||||
groupId = '.'
|
groupId = '.'
|
||||||
version = project.version
|
version = project.version
|
||||||
artifactId = 'besu'
|
artifactId = 'linea-besu'
|
||||||
artifact("$buildDir/distributions/besu-${project.version}.zip")
|
artifact("$buildDir/distributions/linea-besu-${project.version}.zip")
|
||||||
artifact("$buildDir/distributions/besu-${project.version}.tar.gz") { extension = 'tar.gz' }
|
artifact("$buildDir/distributions/linea-besu-${project.version}.tar.gz") { extension = 'tar.gz' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1009,9 +1011,15 @@ distributions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task cloudsmithUpload {
|
||||||
|
dependsOn([distTar, distZip])
|
||||||
|
doLast {
|
||||||
|
exec {
|
||||||
|
executable project.file("scripts/cloudsmith-upload.sh")
|
||||||
|
args rootProject.version, distTar.archiveFile.get(), distZip.archiveFile.get()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
check.dependsOn checkSpdxHeader
|
check.dependsOn checkSpdxHeader
|
||||||
build.dependsOn verifyDistributions
|
build.dependsOn verifyDistributions
|
||||||
artifactoryPublish.dependsOn verifyDistributions
|
|
||||||
artifactoryPublish.mustRunAfter(distTar)
|
|
||||||
artifactoryPublish.mustRunAfter(distZip)
|
|
||||||
artifactoryPublish.mustRunAfter(javadocJar)
|
|
||||||
|
|||||||
19
scripts/cloudsmith-upload.sh
Executable file
19
scripts/cloudsmith-upload.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
LINEA_BESU_VERSION=${1:?Must specify Linea Besu version}
|
||||||
|
TAR_DIST=${2:?Must specify path to tar distribution}
|
||||||
|
ZIP_DIST=${3:?Must specify path to zip distribution}
|
||||||
|
|
||||||
|
ENV_DIR=./build/tmp/cloudsmith-env
|
||||||
|
if [[ -d ${ENV_DIR} ]] ; then
|
||||||
|
source ${ENV_DIR}/bin/activate
|
||||||
|
else
|
||||||
|
python3 -m venv ${ENV_DIR}
|
||||||
|
source ${ENV_DIR}/bin/activate
|
||||||
|
fi
|
||||||
|
|
||||||
|
python3 -m pip install --upgrade cloudsmith-cli
|
||||||
|
|
||||||
|
cloudsmith push raw consensys/linea-besu $TAR_DIST --republish --name 'linea-besu.tar.gz' --version "${LINEA_BESU_VERSION}" --summary "Linea Besu ${LINEA_BESU_VERSION} binary distribution" --description "Binary distribution of Linea Besu ${LINEA_BESU_VERSION}." --content-type 'application/tar+gzip'
|
||||||
|
cloudsmith push raw consensys/linea-besu $ZIP_DIST --republish --name 'linea-besu.zip' --version "${LINEA_BESU_VERSION}" --summary "Linea Besu ${LINEA_BESU_VERSION} binary distribution" --description "Binary distribution of Linea Besu ${LINEA_BESU_VERSION}." --content-type 'application/zip'
|
||||||
Reference in New Issue
Block a user