Skip to content

Commit b6928d6

Browse files
committed
Release pipeline
1 parent 8008025 commit b6928d6

File tree

5 files changed

+403
-1
lines changed

5 files changed

+403
-1
lines changed

.github/release.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# CI pipeline for nf-python
2+
3+
name: nf-python Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
build-plugin:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'temurin'
19+
java-version: '17'
20+
- name: Build Nextflow plugin
21+
run: |
22+
make buildPlugins
23+
- name: Archive plugin zip
24+
uses: actions/upload-artifact@v4
25+
with:
26+
name: nf-python-plugin
27+
path: build/plugins/nf-python-*.zip
28+
29+
build-pypi:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: '3.9'
37+
- name: Build Python package
38+
run: |
39+
cd py
40+
pip install build
41+
python -m build
42+
- name: Archive Python dist
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: nf-python-pypi
46+
path: py/dist/*
47+
48+
publish-pypi:
49+
needs: build-pypi
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
- name: Set up Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: '3.9'
57+
- name: Build Python package
58+
run: |
59+
cd py
60+
pip install build
61+
python -m build
62+
- name: Publish to PyPI
63+
uses: pypa/gh-action-pypi-publish@release/v1
64+
with:
65+
password: ${{ secrets.PYPI_API_TOKEN }}
66+
67+
validate-version:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- name: Extract version from MANIFEST.MF
72+
id: manifest
73+
run: |
74+
version=$(grep '^Plugin-Version:' plugins/nf-python/src/resources/META-INF/MANIFEST.MF | awk '{print $2}')
75+
echo "version=$version" >> $GITHUB_OUTPUT
76+
- name: Extract version from pyproject.toml
77+
id: pyproject
78+
run: |
79+
version=$(grep '^version' py/pyproject.toml | head -1 | cut -d '"' -f2)
80+
echo "version=$version" >> $GITHUB_OUTPUT
81+
- name: Extract version from git tag
82+
id: tag
83+
run: |
84+
tag_version=${GITHUB_REF##*/}
85+
tag_version=${tag_version#v}
86+
echo "version=$tag_version" >> $GITHUB_OUTPUT
87+
- name: Check versions match
88+
run: |
89+
if [ "${{ steps.manifest.outputs.version }}" != "${{ steps.pyproject.outputs.version }}" ]; then
90+
echo "MANIFEST.MF and pyproject.toml versions do not match!"
91+
exit 1
92+
fi
93+
if [ "${{ steps.manifest.outputs.version }}" != "${{ steps.tag.outputs.version }}" ]; then
94+
echo "MANIFEST.MF version and git tag do not match!"
95+
exit 1
96+
fi
97+
echo "All versions match: ${{ steps.manifest.outputs.version }}"
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# CI pipeline for nf-python
2+
3+
name: nf-python Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
validate-version:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Extract version from MANIFEST.MF
16+
id: manifest
17+
run: |
18+
version=$(grep '^Plugin-Version:' plugins/nf-python/src/resources/META-INF/MANIFEST.MF | awk '{print $2}')
19+
echo "version=$version" >> $GITHUB_OUTPUT
20+
- name: Extract version from git tag
21+
id: tag
22+
run: |
23+
tag_version=${GITHUB_REF##*/}
24+
tag_version=${tag_version#v}
25+
echo "version=$tag_version" >> $GITHUB_OUTPUT
26+
- name: Check versions match
27+
run: |
28+
if [ "${{ steps.manifest.outputs.version }}" != "${{ steps.tag.outputs.version }}" ]; then
29+
echo "MANIFEST.MF ${{ steps.manifest.outputs.version }} and git tag ${{ steps.tag.outputs.version }} do not match!"
30+
exit 1
31+
fi
32+
echo "All versions match: ${{ steps.manifest.outputs.version }}"
33+
34+
build-plugin:
35+
needs: validate-version
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Set up JDK 17
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: 'temurin'
43+
java-version: '17'
44+
- name: Build Nextflow plugin
45+
run: |
46+
make buildPlugins
47+
- name: Archive plugin zip
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: nf-python-plugin
51+
path: build/plugins/nf-python-*.zip

.github/workflows/pypi-release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# CI pipeline for nf-python
2+
3+
name: nf-python Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
jobs:
11+
validate-version:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Extract version from pyproject.toml
16+
id: pyproject
17+
run: |
18+
version=$(grep '^version' py/pyproject.toml | head -1 | cut -d '"' -f2)
19+
echo "version=$version" >> $GITHUB_OUTPUT
20+
- name: Extract version from git tag
21+
id: tag
22+
run: |
23+
tag_version=${GITHUB_REF##*/}
24+
tag_version=${tag_version#v}
25+
echo "version=$tag_version" >> $GITHUB_OUTPUT
26+
- name: Check versions match
27+
run: |
28+
if [ "${{ steps.pyproject.outputs.version }}" != "${{ steps.tag.outputs.version }}" ]; then
29+
echo "pyproject.toml ${{ steps.pyproject.outputs.version }} and git tag ${{ steps.tag.outputs.version }} do not match!"
30+
exit 1
31+
fi
32+
echo "All versions match: ${{ steps.pyproject.outputs.version }}"
33+
34+
build-pypi:
35+
needs: validate-version
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
persist-credentials: false
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: "3.x"
45+
- name: Build Python package
46+
run: |
47+
cd py
48+
pip install build
49+
python -m build
50+
- name: Archive Python dist
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: nf-python-pypi
54+
path: py/dist/*
55+
56+
publish-pypi:
57+
needs: build-pypi
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: pypi-publish
61+
url: https://pypi.org/project/nf-python-plugin/
62+
permissions:
63+
id-token: write # Required for trusted publishing
64+
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

0 commit comments

Comments
 (0)