All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jreleaser.workflow.Workflows Maven / Gradle / Ivy

There is a newer version: 1.15.0
Show newest version
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * Copyright 2020-2023 The JReleaser authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jreleaser.workflow;

import org.jreleaser.model.api.JReleaserCommand;
import org.jreleaser.model.internal.JReleaserContext;

import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;

/**
 * @author Andres Almiray
 * @since 0.1.0
 */
public final class Workflows {
    private Workflows() {
        // noop
    }

    public static Workflow download(JReleaserContext context) {
        context.setCommand(JReleaserCommand.DOWNLOAD);
        return new WorkflowImpl(context, singletonList(
            new DownloadWorkflowItem()
        ));
    }

    public static Workflow assemble(JReleaserContext context) {
        context.setCommand(JReleaserCommand.ASSEMBLE);
        return new WorkflowImpl(context, singletonList(
            new AssembleWorkflowItem()
        ));
    }

    public static Workflow changelog(JReleaserContext context) {
        context.setCommand(JReleaserCommand.CHANGELOG);
        return new WorkflowImpl(context, singletonList(
            new ChangelogWorkflowItem()
        ));
    }

    public static Workflow checksum(JReleaserContext context) {
        context.setCommand(JReleaserCommand.CHECKSUM);
        return new WorkflowImpl(context, singletonList(
            new ChecksumWorkflowItem()
        ));
    }

    public static Workflow catalog(JReleaserContext context) {
        context.setCommand(JReleaserCommand.CATALOG);
        return new WorkflowImpl(context, asList(
            new ChecksumWorkflowItem(),
            new CatalogWorkflowItem()
        ));
    }

    public static Workflow sign(JReleaserContext context) {
        context.setCommand(JReleaserCommand.SIGN);
        return new WorkflowImpl(context, asList(
            new ChecksumWorkflowItem(),
            new CatalogWorkflowItem(),
            new SignWorkflowItem()
        ));
    }

    public static Workflow deploy(JReleaserContext context) {
        context.setCommand(JReleaserCommand.DEPLOY);
        return new WorkflowImpl(context, singletonList(
            new DeployWorkflowItem()
        ));
    }

    public static Workflow upload(JReleaserContext context) {
        context.setCommand(JReleaserCommand.UPLOAD);
        return new WorkflowImpl(context, asList(
            new ChecksumWorkflowItem(),
            new CatalogWorkflowItem(),
            new SignWorkflowItem(),
            new UploadWorkflowItem()
        ));
    }

    public static Workflow release(JReleaserContext context) {
        context.setCommand(JReleaserCommand.RELEASE);
        return new WorkflowImpl(context, asList(
            new ChangelogWorkflowItem(),
            new ChecksumWorkflowItem(),
            new CatalogWorkflowItem(),
            new SignWorkflowItem(),
            new DeployWorkflowItem(),
            new UploadWorkflowItem(),
            new ReleaseWorkflowItem()
        ));
    }

    public static Workflow prepare(JReleaserContext context) {
        context.setCommand(JReleaserCommand.PREPARE);
        return new WorkflowImpl(context, asList(
            new ChecksumWorkflowItem(),
            new PrepareWorkflowItem()
        ));
    }

    public static Workflow packageRelease(JReleaserContext context) {
        context.setCommand(JReleaserCommand.PACKAGE);
        return new WorkflowImpl(context, asList(
            new ChecksumWorkflowItem(),
            new PrepareWorkflowItem(),
            new PackageWorkflowItem()
        ));
    }

    public static Workflow publish(JReleaserContext context) {
        context.setCommand(JReleaserCommand.PUBLISH);
        return new WorkflowImpl(context, asList(
            new ChecksumWorkflowItem(),
            new PrepareWorkflowItem(),
            new PackageWorkflowItem(),
            new PublishWorkflowItem()
        ));
    }

    public static Workflow announce(JReleaserContext context) {
        context.setCommand(JReleaserCommand.ANNOUNCE);
        return new WorkflowImpl(context, asList(
            new ChangelogWorkflowItem(),
            new AnnounceWorkflowItem()
        ));
    }

    public static Workflow fullRelease(JReleaserContext context) {
        context.setCommand(JReleaserCommand.FULL_RELEASE);
        return new WorkflowImpl(context, asList(
            new ChangelogWorkflowItem(),
            new ChecksumWorkflowItem(),
            new CatalogWorkflowItem(),
            new SignWorkflowItem(),
            new DeployWorkflowItem(),
            new UploadWorkflowItem(),
            new ReleaseWorkflowItem(),
            new PrepareWorkflowItem(),
            new PackageWorkflowItem(),
            new PublishWorkflowItem(),
            new AnnounceWorkflowItem()
        ));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy