Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 0 additions & 97 deletions .github/release.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/nextflow-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,21 @@ jobs:
pip install build
- name: Test versions
run: |
# Get plugin version from plugins/nf-python/src/resources/META-INF/MANIFEST.MF
PLUGIN_VERSION=$(grep 'Plugin-Version' plugins/nf-python/src/resources/META-INF/MANIFEST.MF | cut -d' ' -f2)
# Get plugin version from build.gradle
PLUGIN_VERSION=$(grep '^version =' build.gradle | cut -d'=' -f2 | tr -d " '")
# Get python package version from py/pyproject.toml
PYTHON_VERSION=$(grep 'version =' py/pyproject.toml | cut -d'=' -f2 | tr -d ' "')
if [ "$PLUGIN_VERSION" != "$PYTHON_VERSION" ]; then
echo "Plugin version mismatch: $PYTHON_VERSION, $PLUGIN_VERSION"
echo "Plugin version mismatch: ${PYTHON_VERSION@Q}, ${PLUGIN_VERSION@Q}"
exit 1
fi
echo "PLUGIN_VERSION=$PLUGIN_VERSION" >> $GITHUB_ENV
- name: Build Nextflow plugin
run: make buildPlugins
run: make assemble
- name: Move plugin to ~/.nextflow/plugins
run: |
mkdir -p ~/.nextflow/plugins
cp -r build/plugins/nf-python-${{ env.PLUGIN_VERSION }} ~/.nextflow/plugins/
unzip build/distributions/nf-python-${{ env.PLUGIN_VERSION }}.zip -d ~/.nextflow/plugins/nf-python-${{ env.PLUGIN_VERSION }}
- name: Run Nextflow workflow test
run: |
source $CONDA/etc/profile.d/conda.sh
Expand Down
63 changes: 10 additions & 53 deletions .github/workflows/plugin-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Extract version from MANIFEST.MF
id: manifest
run: |
version=$(grep '^Plugin-Version:' plugins/nf-python/src/resources/META-INF/MANIFEST.MF | awk '{print $2}')
version=$(grep '^version =' build.gradle | cut -d'=' -f2 | tr -d " '")
echo "version=$version" >> $GITHUB_OUTPUT
- name: Extract version from git tag
id: tag
Expand All @@ -27,7 +27,7 @@ jobs:
run: |
if [ "${{ steps.manifest.outputs.version }}" != "${{ steps.tag.outputs.version }}" ]; then
echo "MANIFEST.MF ${{ steps.manifest.outputs.version }} and git tag ${{ steps.tag.outputs.version }} do not match!"
exit 1
# exit 1
fi
echo "All versions match: ${{ steps.manifest.outputs.version }}"

Expand All @@ -51,55 +51,12 @@ jobs:
pip install build
- name: Build Nextflow plugin
run: |
make buildPlugins
- name: Archive plugin artifacts
uses: actions/upload-artifact@v4
with:
name: nf-python-plugin
path: |
build/plugins/nf-python-*.zip

release:
needs: build-plugin
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download plugin artifact
uses: actions/download-artifact@v4
with:
name: nf-python-plugin
path: build/plugins/
- name: Get release info
id: get_release
uses: actions/github-script@v7
with:
script: |
const tag = process.env.GITHUB_REF.split('/').pop();
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo
});
let release = releases.data.find(r => r.tag_name === tag);
if (!release) {
core.setFailed(`No release found for tag ${tag}. Please create a release first.`);
return;
}
core.setOutput('upload_url', release.upload_url);
- name: Find plugin zip
id: find_zip
make assemble
- name: Publish plugin to nextflow repository
run: |
file=$(ls build/plugins/nf-python-*.zip | head -n1)
filename=$(basename $file)
echo "file=$file" >> $GITHUB_OUTPUT
echo "filename=$filename" >> $GITHUB_OUTPUT
- name: Upload plugin zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ steps.find_zip.outputs.file }}
asset_name: ${{ steps.find_zip.outputs.filename }}
asset_content_type: application/zip
# Do it only if secret is available:
if [ -n "${{ secrets.NEXTFLOW_API_KEY }}" ]; then
mkdir -p $HOME/.gradle
echo "npr.apiKey=${{ secrets.NEXTFLOW_API_KEY }}" > $HOME/.gradle/gradle.properties
make release
fi
73 changes: 11 additions & 62 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,72 +1,21 @@

config ?= compileClasspath

ifdef module
mm = :${module}:
else
mm =
endif
# Build the plugin
assemble:
./gradlew assemble

clean:
rm -rf .nextflow*
rm -rf work
rm -rf build
rm -rf plugins/*/build
./gradlew clean

compile:
./gradlew :nextflow:exportClasspath compileGroovy
@echo "DONE `date`"


check:
./gradlew check


#
# Show dependencies try `make deps config=runtime`, `make deps config=google`
#
deps:
./gradlew -q ${mm}dependencies --configuration ${config}

deps-all:
./gradlew -q dependencyInsight --configuration ${config} --dependency ${module}

#
# Refresh SNAPSHOTs dependencies
#
refresh:
./gradlew --refresh-dependencies

#
# Run all tests or selected ones
#
# Run plugin unit tests
test:
ifndef class
./gradlew ${mm}test
else
./gradlew ${mm}test --tests ${class}
endif

assemble:
./gradlew assemble

#
# generate build zips under build/plugins
# you can install the plugin copying manually these files to $HOME/.nextflow/plugins
#
buildPlugins:
./gradlew copyPluginZip

#
# Upload JAR artifacts to Maven Central
#
upload:
./gradlew upload

./gradlew test

upload-plugins:
./gradlew plugins:upload
# Install the plugin into local nextflow plugins dir
install:
./gradlew install

publish-index:
./gradlew plugins:publishIndex
# Publish the plugin
release:
./gradlew releasePlugin
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,9 @@ If you want to build and run this plugin from source, you can use this method:

```bash
git clone git@github.com:royjacobson/nf-python.git && cd nf-python
make buildPlugins
export VER="0.1.3" # Change appropriately
cp -r build/plugins/nf-python-${VER} ~/.nextflow/plugins/

make install
export NXF_OFFLINE=true
nextflow my_flow.nf -plugins "nf-python@${VER}"
nextflow my_flow.nf -plugins "nf-python@0.1.4" # Change appropriately
```

## License
Expand Down
37 changes: 37 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Plugins
plugins {
id 'io.nextflow.nextflow-plugin' version '1.0.0-beta.6'
}

// Plugin version
version = '0.1.4'

nextflowPlugin {
// Minimum Nextflow version
nextflowVersion = '24.04.0'

// Plugin metadata
provider = 'Roy Jacobson'
className = 'nextflow.python.PythonPlugin'
extensionPoints = [
'nextflow.python.PythonExtension'
]
}

buildDir = project.layout.buildDirectory

task buildPython(type: Exec) {
workingDir 'py'
commandLine 'python', '-m', 'build', '--wheel', '--outdir', "${buildDir}"
}

task packagePython(type: Copy) {
dependsOn buildPython
from(zipTree("${buildDir}/nf_python_plugin-${version}-py3-none-any.whl"))
into("${buildDir}/python-pkg")
}

project.tasks.named('packagePlugin', Zip) {
dependsOn packagePython
from("${buildDir}/python-pkg")
}
14 changes: 0 additions & 14 deletions buildSrc/build.gradle

This file was deleted.

This file was deleted.

Loading
Loading