diff --git a/LICENSE b/LICENSE index 91f00bb..4538a2b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 snakemake +Copyright (c) 2019-2026 The Snakemake team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 7b0e4a3..2ea389d 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Preliminary commands to run before the workflow execution. ### `task` -Whether to run Snakemake or to generate a container image specification (in the form of a Dockerfile) that contains all required environments. Can be either `run` or `containerize`. Default `run`. +Whether to run Snakemake or to generate a container image specification (`Dockerfile`, `apptainer.def`) that contains all required environments. Can be either `run` or `containerize`. Default `run`. ### `show-disk-usage-on-error` @@ -36,6 +36,14 @@ Snakemake version to install from conda. Default `*` (latest available version f Optional Snakemake git branch to install from `https://github.com/snakemake/snakemake`. If set, this takes precedence over `snakemake-version` and Snakemake is installed from source via pip. +### `install-apptainer` + +Whether to install Apptainer (true/false). Default `false`. + +### `containerize-args` + +Additional arguments for `containerize`, can be one of 'dockerfile', 'apptainer' or '' (defaults to dockerfile). + ## Example usage ```yaml @@ -69,4 +77,5 @@ Optional Snakemake git branch to install from `https://github.com/snakemake/snak directory: ".test" snakefile: "workflow/Snakefile" task: "containerize" + containerize-args: "apptainer" ``` diff --git a/action.yml b/action.yml index 87742da..3070922 100644 --- a/action.yml +++ b/action.yml @@ -45,6 +45,10 @@ inputs: description: Install Apptainer (true/false) required: false default: "false" + containerize-args: + description: Additional arguments for --containerize, can be one of 'dockerfile', 'apptainer' or '' (defaults to dockerfile) + required: false + default: "" runs: using: "composite" @@ -117,4 +121,10 @@ runs: - name: Containerize snakemake if: ${{ inputs.task == 'containerize' }} shell: bash -el {0} - run: snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }} --containerize > Dockerfile + run: | + if [[ "${{ inputs.containerize-args }}" == "apptainer" ]]; then + recipe="apptainer.def" + else + recipe="Dockerfile" + fi + snakemake --directory ${{ inputs.directory }} --snakefile ${{ inputs.snakefile }} --show-failed-logs ${{ inputs.args }} --containerize ${{ inputs.containerize-args }} > $recipe