Skip to content

Commit 8311108

Browse files
committed
* Create release pipelines for nf-python
* Bump version to 0.1.1
1 parent 39caaab commit 8311108

File tree

5 files changed

+61
-23
lines changed

5 files changed

+61
-23
lines changed

.github/workflows/nextflow-plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
env:
13-
NF_PYTHON_VERSION: '0.0.1'
13+
NF_PYTHON_VERSION: '0.1.1'
1414
NXF_OFFLINE: 'true'
1515
steps:
1616
- uses: actions/checkout@v4

.github/workflows/plugin-release.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CI pipeline for nf-python
22

3-
name: nf-python Release
3+
name: plugin Release
44

55
on:
66
push:
@@ -49,3 +49,48 @@ jobs:
4949
with:
5050
name: nf-python-plugin
5151
path: build/plugins/nf-python-*.zip
52+
53+
release:
54+
needs: build-plugin
55+
runs-on: ubuntu-latest
56+
permissions:
57+
contents: write
58+
steps:
59+
- uses: actions/checkout@v4
60+
- name: Download plugin artifact
61+
uses: actions/download-artifact@v4
62+
with:
63+
name: nf-python-plugin
64+
path: build/plugins/
65+
- name: Get release info
66+
id: get_release
67+
uses: actions/github-script@v7
68+
with:
69+
script: |
70+
const tag = process.env.GITHUB_REF.split('/').pop();
71+
const releases = await github.rest.repos.listReleases({
72+
owner: context.repo.owner,
73+
repo: context.repo.repo
74+
});
75+
let release = releases.data.find(r => r.tag_name === tag);
76+
if (!release) {
77+
core.setFailed(`No release found for tag ${tag}. Please create a release first.`);
78+
return;
79+
}
80+
core.setOutput('upload_url', release.upload_url);
81+
- name: Find plugin zip
82+
id: find_zip
83+
run: |
84+
file=$(ls build/plugins/nf-python-*.zip | head -n1)
85+
filename=$(basename $file)
86+
echo "file=$file" >> $GITHUB_OUTPUT
87+
echo "filename=$filename" >> $GITHUB_OUTPUT
88+
- name: Upload plugin zip to release
89+
uses: actions/upload-release-asset@v1
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
with:
93+
upload_url: ${{ steps.get_release.outputs.upload_url }}
94+
asset_path: ${{ steps.find_zip.outputs.file }}
95+
asset_name: ${{ steps.find_zip.outputs.filename }}
96+
asset_content_type: application/zip

.github/workflows/pypi-release.yml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,30 +50,23 @@ jobs:
5050
- name: Archive Python dist
5151
uses: actions/upload-artifact@v4
5252
with:
53-
name: nf-python-pypi
53+
name: python-package-distributions
5454
path: py/dist/*
5555

5656
publish-pypi:
5757
needs: build-pypi
5858
runs-on: ubuntu-latest
5959
environment:
6060
name: pypi-publish
61-
url: https://pypi.org/project/nf-python-plugin/
61+
url: https://pypi.org/p/nf-python-plugin/
6262
permissions:
63-
id-token: write # Required for trusted publishing
63+
id-token: write
64+
6465
steps:
65-
- uses: actions/checkout@v4
66-
- name: Set up Python
67-
uses: actions/setup-python@v5
68-
with:
69-
python-version: '3.9'
70-
- name: Build Python package
71-
run: |
72-
cd py
73-
pip install build
74-
python -m build
75-
- name: Publish to PyPI (trusted publishing)
76-
uses: pypa/gh-action-pypi-publish@release/v1
77-
with:
78-
# No password needed for trusted publishing
79-
verbose: true
66+
- name: Download all the dists
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: python-package-distributions
70+
path: dist/
71+
- name: Publish distribution 📦 to PyPI
72+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Manifest-Version: 1.0
22
Plugin-Id: nf-python
3-
Plugin-Version: 0.0.1
3+
Plugin-Version: 0.1.1
44
Plugin-Class: nextflow.python.PythonPlugin
55
Plugin-Provider: nextflow
66
Plugin-Requires: >=22.04.0

py/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
2-
name = "nf-python"
3-
version = "0.0.1"
2+
name = "nf-python-plugin"
3+
version = "0.1.1"
44
authors = [
55
{ name="Roy Jacobson", email="[email protected]" },
66
]

0 commit comments

Comments
 (0)