# BlumeOps Release Workflow # # Creates a versioned release of BlumeOps with all build artifacts. # Currently includes: # - Documentation site (Quartz static build) # # Future additions may include other release artifacts. # # Usage: # 1. Go to Actions > Build BlumeOps > Run workflow # 2. Enter a version tag (e.g., v1.2.0) or leave empty to auto-increment patch # 3. The workflow creates a release with attached artifacts # # Documentation asset URL: # https://forge.ops.eblu.me/eblume/blumeops/releases/download//docs-.tar.gz name: Build BlumeOps on: workflow_dispatch: inputs: version: description: 'Version (e.g., v1.2.0) or empty to auto-increment patch (v_._.+1)' required: false default: '' type: string jobs: build: runs-on: k8s steps: - name: Resolve version id: version run: | INPUT_VERSION="${{ inputs.version }}" if [ -n "$INPUT_VERSION" ]; then # User provided a version - validate it if [[ ! "$INPUT_VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Error: Version must be in format vX.Y.Z (e.g., v1.0.0)" exit 1 fi VERSION="$INPUT_VERSION" echo "Using provided version: $VERSION" else # Auto-increment patch version from latest release echo "Fetching latest release..." LATEST=$(curl -s "https://forge.ops.eblu.me/api/v1/repos/eblume/blumeops/releases/latest" | jq -r '.tag_name // empty' || true) if [ -z "$LATEST" ]; then VERSION="v1.0.0" echo "No previous releases found, starting at: $VERSION" else # Parse vX.Y.Z and increment patch VERSION=$(echo "$LATEST" | awk -F. '{print $1"."$2"."$3+1}') echo "Auto-incremented from $LATEST to: $VERSION" fi fi # Check if this version already exists if curl -sf "https://forge.ops.eblu.me/api/v1/repos/eblume/blumeops/releases/tags/$VERSION" > /dev/null 2>&1; then echo "Error: Release $VERSION already exists" echo "See: https://forge.ops.eblu.me/eblume/blumeops/releases/tag/$VERSION" exit 1 fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "Building BlumeOps release: $VERSION" - name: Checkout uses: actions/checkout@v4 - name: Build docs run: | VERSION="${{ steps.version.outputs.version }}" echo "Node version: $(node --version)" echo "NPM version: $(npm --version)" # Clone Quartz git clone --depth 1 https://github.com/jackyzha0/quartz.git /tmp/quartz cd /tmp/quartz # Install dependencies npm ci # Copy our configuration (lives in docs/ to keep repo root clean) cp "$GITHUB_WORKSPACE/docs/quartz.config.ts" . cp "$GITHUB_WORKSPACE/docs/quartz.layout.ts" . # Copy docs as content (includes index.md) rm -rf content cp -r "$GITHUB_WORKSPACE/docs" content # Build echo "Building static site..." npx quartz build # Create tarball TARBALL="docs-${VERSION}.tar.gz" echo "Creating tarball: $TARBALL" tar -czf "$GITHUB_WORKSPACE/$TARBALL" -C public . echo "Build complete!" ls -lh "$GITHUB_WORKSPACE/$TARBALL" - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | VERSION="${{ steps.version.outputs.version }}" TARBALL="docs-${VERSION}.tar.gz" echo "Creating release $VERSION..." # Use Forgejo API to create release (requires authentication) RELEASE_DATA=$(cat <