|
| 1 | +#!/bin/bash |
| 2 | +# |
| 3 | +# Nextflow Release Script |
| 4 | +# |
| 5 | +# This script performs the complete Nextflow release process including: |
| 6 | +# - Building and assembling artifacts |
| 7 | +# - Uploading to S3 and Maven repositories |
| 8 | +# - Releasing plugins to registry |
| 9 | +# - Creating GitHub releases with signed artifacts |
| 10 | +# |
| 11 | +# REQUIRED SECRETS/ENVIRONMENT VARIABLES FOR GITHUB ACTIONS: |
| 12 | +# |
| 13 | +# AWS S3 Deployment: |
| 14 | +# NXF_AWS_ACCESS - AWS Access Key for deploying to s3://www2.nextflow.io |
| 15 | +# NXF_AWS_SECRET - AWS Secret Key for S3 deployment |
| 16 | +# |
| 17 | +# Maven Repository (Seqera S3-based): |
| 18 | +# AWS_ACCESS_KEY_ID - AWS credentials for Maven repository access |
| 19 | +# AWS_SECRET_ACCESS_KEY - AWS secret for Maven repository access |
| 20 | +# |
| 21 | +# GitHub Integration: |
| 22 | +# GITHUB_TOKEN - For creating releases and uploading assets |
| 23 | +# |
| 24 | +# Plugin Registry: |
| 25 | +# NPR_API_URL - Nextflow Plugin Registry API URL |
| 26 | +# NPR_API_KEY - Nextflow Plugin Registry API key |
| 27 | +# |
| 28 | +# Container Registry Authentication: |
| 29 | +# DOCKERHUB_USERNAME - Docker Hub username for container publishing |
| 30 | +# DOCKERHUB_TOKEN - Docker Hub token/password for container publishing |
| 31 | +# SEQERA_PUBLIC_CR_PASSWORD - Seqera public container registry password |
| 32 | +# |
| 33 | +# Usage: Only run when commit message contains '[release]' |
| 34 | +# |
| 35 | +set -e |
| 36 | + |
| 37 | +echo "=== Starting Nextflow Release Process ===" |
| 38 | +echo "Commit message: ${GITHUB_HEAD_COMMIT_MESSAGE:-$(git log -1 --pretty=format:'%s')}" |
| 39 | + |
| 40 | +# Check required environment variables |
| 41 | +echo "=== Checking required environment variables ===" |
| 42 | +REQUIRED_VARS=( |
| 43 | + "NXF_AWS_ACCESS" |
| 44 | + "NXF_AWS_SECRET" |
| 45 | + "AWS_ACCESS_KEY_ID" |
| 46 | + "AWS_SECRET_ACCESS_KEY" |
| 47 | + "GITHUB_TOKEN" |
| 48 | + "NPR_API_URL" |
| 49 | + "NPR_API_KEY" |
| 50 | +) |
| 51 | + |
| 52 | +MISSING_VARS=() |
| 53 | +for var in "${REQUIRED_VARS[@]}"; do |
| 54 | + if [ -z "${!var}" ]; then |
| 55 | + MISSING_VARS+=("$var") |
| 56 | + else |
| 57 | + echo "✓ $var is set" |
| 58 | + fi |
| 59 | +done |
| 60 | + |
| 61 | +if [ ${#MISSING_VARS[@]} -ne 0 ]; then |
| 62 | + echo "❌ ERROR: The following required environment variables are not set:" |
| 63 | + for var in "${MISSING_VARS[@]}"; do |
| 64 | + echo " - $var" |
| 65 | + done |
| 66 | + echo "Please ensure all required environment variables are configured before running the release." |
| 67 | + exit 1 |
| 68 | +fi |
| 69 | + |
| 70 | +echo "✅ All required environment variables are set" |
| 71 | + |
| 72 | +echo "🔧 === Step 1: Assemble, upload, and deploy ===" |
| 73 | +make assemble upload deploy |
| 74 | +echo "✅ Step 1 completed successfully" |
| 75 | +echo "" |
| 76 | + |
| 77 | +echo "🔌 === Step 2: Release plugins ===" |
| 78 | +make release-plugins |
| 79 | +echo "✅ Step 2 completed successfully" |
| 80 | +echo "" |
| 81 | + |
| 82 | +echo "🚀 === Step 3: Final release ===" |
| 83 | +make release |
| 84 | +echo "✅ Step 3 completed successfully" |
| 85 | +echo "" |
| 86 | + |
| 87 | +echo "🎉 === Release process completed successfully ===" |
0 commit comments