From efbb785a187430e743fe386e4dbd40c6e8320ee5 Mon Sep 17 00:00:00 2001 From: Tom Sellman Date: Thu, 12 Dec 2024 11:12:59 +0000 Subject: [PATCH] Move release scripts to their own 'release' dir (and do some testing of the github action/scripts) Signed-off-by: Tom Sellman --- .github/scripts/deploy-to-docker.sh | 28 ---------- .github/scripts/release.sh | 28 ---------- .github/scripts/update-plugins-index.sh | 11 ---- .github/workflows/build.yml | 6 ++- Makefile | 3 +- build.gradle | 7 ++- make-release.sh | 8 +++ plugins/build.gradle | 4 +- .../deploy-plugins-to-github.sh | 11 ++-- .../deploy-plugins-to-maven.sh | 8 ++- release/deploy-to-docker.sh | 43 +++++++++++++++ .../scripts => release}/deploy-to-github.sh | 8 ++- .../scripts => release}/deploy-to-maven.sh | 8 ++- {.github/scripts => release}/deploy-to-s3.sh | 11 +++- release/main.sh | 52 +++++++++++++++++++ .../publish-launcher-script.sh | 16 ++++-- {.github/scripts => release}/tag-release.sh | 10 +++- release/update-plugins-index.sh | 15 ++++++ 18 files changed, 184 insertions(+), 93 deletions(-) delete mode 100755 .github/scripts/deploy-to-docker.sh delete mode 100644 .github/scripts/release.sh delete mode 100755 .github/scripts/update-plugins-index.sh rename {.github/scripts => release}/deploy-plugins-to-github.sh (84%) rename {.github/scripts => release}/deploy-plugins-to-maven.sh (73%) create mode 100755 release/deploy-to-docker.sh rename {.github/scripts => release}/deploy-to-github.sh (88%) rename {.github/scripts => release}/deploy-to-maven.sh (70%) rename {.github/scripts => release}/deploy-to-s3.sh (81%) create mode 100644 release/main.sh rename .github/scripts/publish-release.sh => release/publish-launcher-script.sh (68%) rename {.github/scripts => release}/tag-release.sh (58%) create mode 100755 release/update-plugins-index.sh diff --git a/.github/scripts/deploy-to-docker.sh b/.github/scripts/deploy-to-docker.sh deleted file mode 100755 index 5148abcce3..0000000000 --- a/.github/scripts/deploy-to-docker.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash -set -e - -# change to the project root -cd "$(dirname "$0")/../.." - -# read the nextflow version -read -r NF_VERSION /dev/null 2>&1 \ && release_exists=true # if not exists, create github release, with zip & meta json files - if [[ $release_exists ]]; then + if [[ $release_exists == true ]]; then echo "Plugin $plugin_name $plugin_version already deployed to github, skipping" else gh release create \ diff --git a/.github/scripts/deploy-plugins-to-maven.sh b/release/deploy-plugins-to-maven.sh similarity index 73% rename from .github/scripts/deploy-plugins-to-maven.sh rename to release/deploy-plugins-to-maven.sh index 114129caba..238093625a 100755 --- a/.github/scripts/deploy-plugins-to-maven.sh +++ b/release/deploy-plugins-to-maven.sh @@ -2,9 +2,13 @@ set -e # change to the project root -cd "$(dirname "$0")/../.." +cd "$(dirname "$0")/.." -echo "Publishing plugins to maven" +echo " +--------------------------------- +-- Publishing plugins to maven -- +--------------------------------- +" # the release process should have already built the jars, so to avoid re-compiling everything # we can tell gradle to skip all non publish/publication related tasks diff --git a/release/deploy-to-docker.sh b/release/deploy-to-docker.sh new file mode 100755 index 0000000000..4779582f73 --- /dev/null +++ b/release/deploy-to-docker.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash +set -e + +# change to the project root +cd "$(dirname "$0")/.." + +# read the nextflow version +read -r NF_VERSION /dev/null 2>&1 \ && release_exists=true -if [[ $release_exists ]]; then +if [[ $release_exists == true ]]; then echo "Version $NF_VERSION already deployed to S3, skipping" exit fi diff --git a/release/main.sh b/release/main.sh new file mode 100644 index 0000000000..2ecee62fe1 --- /dev/null +++ b/release/main.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -e + +# ----------------------------------------------------------------------------- +# Nextflow release script +# +# This is the orchestration script for Nextflow releases. +# +# It is intended to be run by 'headless' CI environments (eg Github Actions) +# to execute a release.You probably don't want to run this script directly. +# +# Instead, use the `make release` command to be guided through the process. +# ----------------------------------------------------------------------------- + +# set defaults for unspecified env vars +export GH_ORG=${GH_ORG:-'nextflow-io'} +export GH_USER=${GH_USER:-'pditommaso'} # TODO - use a service user for releases +export GH_USER_EMAIL=${GH_USER_EMAIL:-'paolo.ditommaso@gmail.com'} + +export MAVEN_PUBLISH_URL=${MAVEN_PUBLISH_URL:-'s3://maven.seqera.io'} +export PLUGINS_INDEX_JSON=${PLUGINS_INDEX_JSON:-'https://github.com/nextflow-io/plugins/main/plugins.json'} +export S3_RELEASE_BUCKET=${S3_RELEASE_BUCKET:-'www2.nextflow.io'} +export SEQERA_CONTAINER_REGISTRY=${SEQERA_CONTAINER_REGISTRY:-'public.cr.seqera.io'} + +# change to the project root +cd "$(dirname "$0")/.." + +# build artifacts +make distribution + +# tag release +./release/tag-release.sh + +# deploy to maven +./release/deploy-to-maven.sh + +# deploy to S3 +./release/deploy-to-s3.sh + +# deploy to docker +./release/deploy-to-docker.sh + +# deploy to github +./release/deploy-to-github.sh + +# deploy plugins +./release/deploy-plugins-to-maven.sh +./release/deploy-plugins-to-github.sh +./release/update-plugins-index.sh + +# finally, publish the new launcher +./release/publish-launcher-script.sh diff --git a/.github/scripts/publish-release.sh b/release/publish-launcher-script.sh similarity index 68% rename from .github/scripts/publish-release.sh rename to release/publish-launcher-script.sh index ffbd319be6..7ee69ec937 100755 --- a/.github/scripts/publish-release.sh +++ b/release/publish-launcher-script.sh @@ -2,12 +2,18 @@ set -e # change to the project root -cd "$(dirname "$0")/../.." +cd "$(dirname "$0")/.." # read the nextflow version read -r NF_VERSION