Skip to content

Commit 9b47412

Browse files
committed
[*] Update infrastructure to the new plugin registry
1 parent f492ddd commit 9b47412

21 files changed

Lines changed: 242 additions & 704 deletions

.github/release.yml

Lines changed: 0 additions & 97 deletions
This file was deleted.

.github/workflows/nextflow-plugin.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ jobs:
3636
pip install build
3737
- name: Test versions
3838
run: |
39-
# Get plugin version from plugins/nf-python/src/resources/META-INF/MANIFEST.MF
40-
PLUGIN_VERSION=$(grep 'Plugin-Version' plugins/nf-python/src/resources/META-INF/MANIFEST.MF | cut -d' ' -f2)
39+
# Get plugin version from build.gradle
40+
PLUGIN_VERSION=$(grep '^version =' build.gradle | cut -d'=' -f2 | tr -d " '")
4141
# Get python package version from py/pyproject.toml
4242
PYTHON_VERSION=$(grep 'version =' py/pyproject.toml | cut -d'=' -f2 | tr -d ' "')
4343
if [ "$PLUGIN_VERSION" != "$PYTHON_VERSION" ]; then
44-
echo "Plugin version mismatch: $PYTHON_VERSION, $PLUGIN_VERSION"
44+
echo "Plugin version mismatch: ${PYTHON_VERSION@Q}, ${PLUGIN_VERSION@Q}"
4545
exit 1
4646
fi
4747
echo "PLUGIN_VERSION=$PLUGIN_VERSION" >> $GITHUB_ENV
4848
- name: Build Nextflow plugin
49-
run: make buildPlugins
49+
run: make assemble
5050
- name: Move plugin to ~/.nextflow/plugins
5151
run: |
5252
mkdir -p ~/.nextflow/plugins
53-
cp -r build/plugins/nf-python-${{ env.PLUGIN_VERSION }} ~/.nextflow/plugins/
53+
unzip build/distributions/nf-python-${{ env.PLUGIN_VERSION }}.zip -d ~/.nextflow/plugins/nf-python-${{ env.PLUGIN_VERSION }}
5454
- name: Run Nextflow workflow test
5555
run: |
5656
source $CONDA/etc/profile.d/conda.sh

.github/workflows/plugin-release.yml

Lines changed: 10 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Extract version from MANIFEST.MF
1616
id: manifest
1717
run: |
18-
version=$(grep '^Plugin-Version:' plugins/nf-python/src/resources/META-INF/MANIFEST.MF | awk '{print $2}')
18+
version=$(grep '^version =' build.gradle | cut -d'=' -f2 | tr -d " '")
1919
echo "version=$version" >> $GITHUB_OUTPUT
2020
- name: Extract version from git tag
2121
id: tag
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
if [ "${{ steps.manifest.outputs.version }}" != "${{ steps.tag.outputs.version }}" ]; then
2929
echo "MANIFEST.MF ${{ steps.manifest.outputs.version }} and git tag ${{ steps.tag.outputs.version }} do not match!"
30-
exit 1
30+
# exit 1
3131
fi
3232
echo "All versions match: ${{ steps.manifest.outputs.version }}"
3333
@@ -51,55 +51,12 @@ jobs:
5151
pip install build
5252
- name: Build Nextflow plugin
5353
run: |
54-
make buildPlugins
55-
- name: Archive plugin artifacts
56-
uses: actions/upload-artifact@v4
57-
with:
58-
name: nf-python-plugin
59-
path: |
60-
build/plugins/nf-python-*.zip
61-
62-
release:
63-
needs: build-plugin
64-
runs-on: ubuntu-latest
65-
permissions:
66-
contents: write
67-
steps:
68-
- uses: actions/checkout@v4
69-
- name: Download plugin artifact
70-
uses: actions/download-artifact@v4
71-
with:
72-
name: nf-python-plugin
73-
path: build/plugins/
74-
- name: Get release info
75-
id: get_release
76-
uses: actions/github-script@v7
77-
with:
78-
script: |
79-
const tag = process.env.GITHUB_REF.split('/').pop();
80-
const releases = await github.rest.repos.listReleases({
81-
owner: context.repo.owner,
82-
repo: context.repo.repo
83-
});
84-
let release = releases.data.find(r => r.tag_name === tag);
85-
if (!release) {
86-
core.setFailed(`No release found for tag ${tag}. Please create a release first.`);
87-
return;
88-
}
89-
core.setOutput('upload_url', release.upload_url);
90-
- name: Find plugin zip
91-
id: find_zip
54+
make assemble
55+
- name: Publish plugin to nextflow repository
9256
run: |
93-
file=$(ls build/plugins/nf-python-*.zip | head -n1)
94-
filename=$(basename $file)
95-
echo "file=$file" >> $GITHUB_OUTPUT
96-
echo "filename=$filename" >> $GITHUB_OUTPUT
97-
- name: Upload plugin zip to release
98-
uses: actions/upload-release-asset@v1
99-
env:
100-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
101-
with:
102-
upload_url: ${{ steps.get_release.outputs.upload_url }}
103-
asset_path: ${{ steps.find_zip.outputs.file }}
104-
asset_name: ${{ steps.find_zip.outputs.filename }}
105-
asset_content_type: application/zip
57+
# Do it only if secret is available:
58+
if [ -n "${{ secrets.NEXTFLOW_API_KEY }}" ]; then
59+
mkdir -p $HOME/.gradle
60+
echo "npr.apiKey=${{ secrets.NEXTFLOW_API_KEY }}" > $HOME/.gradle/gradle.properties
61+
make release
62+
fi

Makefile

Lines changed: 11 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,21 @@
1-
2-
config ?= compileClasspath
3-
4-
ifdef module
5-
mm = :${module}:
6-
else
7-
mm =
8-
endif
1+
# Build the plugin
2+
assemble:
3+
./gradlew assemble
94

105
clean:
116
rm -rf .nextflow*
127
rm -rf work
138
rm -rf build
14-
rm -rf plugins/*/build
159
./gradlew clean
1610

17-
compile:
18-
./gradlew :nextflow:exportClasspath compileGroovy
19-
@echo "DONE `date`"
20-
21-
22-
check:
23-
./gradlew check
24-
25-
26-
#
27-
# Show dependencies try `make deps config=runtime`, `make deps config=google`
28-
#
29-
deps:
30-
./gradlew -q ${mm}dependencies --configuration ${config}
31-
32-
deps-all:
33-
./gradlew -q dependencyInsight --configuration ${config} --dependency ${module}
34-
35-
#
36-
# Refresh SNAPSHOTs dependencies
37-
#
38-
refresh:
39-
./gradlew --refresh-dependencies
40-
41-
#
42-
# Run all tests or selected ones
43-
#
11+
# Run plugin unit tests
4412
test:
45-
ifndef class
46-
./gradlew ${mm}test
47-
else
48-
./gradlew ${mm}test --tests ${class}
49-
endif
50-
51-
assemble:
52-
./gradlew assemble
53-
54-
#
55-
# generate build zips under build/plugins
56-
# you can install the plugin copying manually these files to $HOME/.nextflow/plugins
57-
#
58-
buildPlugins:
59-
./gradlew copyPluginZip
60-
61-
#
62-
# Upload JAR artifacts to Maven Central
63-
#
64-
upload:
65-
./gradlew upload
66-
13+
./gradlew test
6714

68-
upload-plugins:
69-
./gradlew plugins:upload
15+
# Install the plugin into local nextflow plugins dir
16+
install:
17+
./gradlew install
7018

71-
publish-index:
72-
./gradlew plugins:publishIndex
19+
# Publish the plugin
20+
release:
21+
./gradlew releasePlugin

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,9 @@ If you want to build and run this plugin from source, you can use this method:
8080

8181
```bash
8282
git clone git@github.com:royjacobson/nf-python.git && cd nf-python
83-
make buildPlugins
84-
export VER="0.1.4" # Change appropriately
85-
cp -r build/plugins/nf-python-${VER} ~/.nextflow/plugins/
86-
83+
make install
8784
export NXF_OFFLINE=true
88-
nextflow my_flow.nf -plugins "nf-python@${VER}"
85+
nextflow my_flow.nf -plugins "nf-python@0.1.4" # Change appropriately
8986
```
9087

9188
## License

build.gradle

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Plugins
2+
plugins {
3+
id 'io.nextflow.nextflow-plugin' version '1.0.0-beta.6'
4+
}
5+
6+
// Plugin version
7+
version = '0.1.4'
8+
9+
nextflowPlugin {
10+
// Minimum Nextflow version
11+
nextflowVersion = '24.04.0'
12+
13+
// Plugin metadata
14+
provider = 'Roy Jacobson'
15+
className = 'nextflow.python.PythonPlugin'
16+
extensionPoints = [
17+
'nextflow.python.PythonExtension'
18+
]
19+
}
20+
21+
buildDir = project.layout.buildDirectory
22+
23+
task buildPython(type: Exec) {
24+
workingDir 'py'
25+
commandLine 'python', '-m', 'build', '--wheel', '--outdir', "${buildDir}"
26+
}
27+
28+
task packagePython(type: Copy) {
29+
dependsOn buildPython
30+
from(zipTree("${buildDir}/nf_python_plugin-${version}-py3-none-any.whl"))
31+
into("${buildDir}/python-pkg")
32+
}
33+
34+
project.tasks.named('packagePlugin', Zip) {
35+
dependsOn packagePython
36+
from("${buildDir}/python-pkg")
37+
}

buildSrc/build.gradle

Lines changed: 0 additions & 14 deletions
This file was deleted.

buildSrc/src/main/groovy/io.nextflow.groovy-application-conventions.gradle

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)