From de8d43b5f7a2746ff3dce4770fdc313372ccf965 Mon Sep 17 00:00:00 2001 From: Nico Stuurman Date: Thu, 21 Aug 2025 09:58:22 -0700 Subject: [PATCH 1/4] Build: transition to maven central deployment. --- .github/workflows/build_and_deploy.yml | 13 +++++----- java/pom.xml | 36 ++++++++++++-------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 38197d4b..74b123ff 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -47,7 +47,7 @@ jobs: if: ${{ needs.check-java-version.outputs.changed == 'true' }} - name: Deploy PycroManagerJava.jar to Sonatype OSS + name: Deploy PycroManagerJava.jar to Maven central runs-on: ubuntu-latest steps: @@ -65,18 +65,17 @@ jobs: with: # running setup-java again overwrites the settings.xml java-version: 8 distribution: 'zulu' - - server-id: ossrh - server-username: OSSRH_USERNAME - server-password: OSSRH_PASSWORD + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Publish to Apache Maven Central run: mvn deploy --file java/pom.xml -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PASSPHRASE }} env: - OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} - OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + OSSRH_USERNAME: ${{ secrets.MAVEN_USERNAME }} + OSSRH_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/java/pom.xml b/java/pom.xml index ae5abb19..7c1ad3aa 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -23,7 +23,7 @@ nicost Nico Stuurman - UCSF/HHMI + UCSF @@ -55,7 +55,7 @@ org.micro-manager.acqengj AcqEngJ - 0.39.0 + 0.39.2 org.micro-manager.ndviewer @@ -111,11 +111,11 @@ sign - - - --pinentry-mode - loopback - + + + --pinentry-mode + loopback + @@ -123,17 +123,15 @@ - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.13 - true - - ossrh - https://s01.oss.sonatype.org/ - true - 20 - - + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 + true + + central + true + published + @@ -148,4 +146,4 @@ - \ No newline at end of file + From 792349a95f82593745a7e42d51e54d3ab7a6d609 Mon Sep 17 00:00:00 2001 From: Nico Stuurman Date: Thu, 21 Aug 2025 11:09:34 -0700 Subject: [PATCH 2/4] Build: add debug output to conftest.py to see why the core is not found while running test on github using github actions. --- pycromanager/test/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pycromanager/test/conftest.py b/pycromanager/test/conftest.py index 1c5992fc..4a8eb4fe 100644 --- a/pycromanager/test/conftest.py +++ b/pycromanager/test/conftest.py @@ -62,6 +62,8 @@ def install_mm(): # Download an install latest nightly build mm_install_dir = download_and_install_mm(destination='auto') + print('Micro-Manager installed in ' + mm_install_dir) + #### Replace with newer versions of Java libraries #### # find pycro-manager/java path if os.path.isdir('java'): From 05c699dfb4866829ca51e0d80e2a029810f324b6 Mon Sep 17 00:00:00 2001 From: Nico Stuurman Date: Thu, 21 Aug 2025 11:28:50 -0700 Subject: [PATCH 3/4] Fix broken tests due to unchecked changes in mmpycores API. --- pycromanager/test/conftest.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pycromanager/test/conftest.py b/pycromanager/test/conftest.py index 4a8eb4fe..c7962f49 100644 --- a/pycromanager/test/conftest.py +++ b/pycromanager/test/conftest.py @@ -55,10 +55,12 @@ def install_mm(): if is_port_in_use(4827): print('Using Micro-manager running on port 4827 for testing') yield - elif find_existing_mm_install(): + try: + path = find_existing_mm_install() print('Micro-Manager is already installed, skipping installation') - yield find_existing_mm_install() - else: + yield path + except FileNotFoundException: + print("No Micro-Manager installation found, installing now") # Download an install latest nightly build mm_install_dir = download_and_install_mm(destination='auto') From cd1d2c7c0e6d9e186dc41ed06255d26ef175caf7 Mon Sep 17 00:00:00 2001 From: Nico Stuurman Date: Thu, 21 Aug 2025 11:37:21 -0700 Subject: [PATCH 4/4] Build: Error not Exception.. --- pycromanager/test/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycromanager/test/conftest.py b/pycromanager/test/conftest.py index c7962f49..66a19938 100644 --- a/pycromanager/test/conftest.py +++ b/pycromanager/test/conftest.py @@ -59,7 +59,7 @@ def install_mm(): path = find_existing_mm_install() print('Micro-Manager is already installed, skipping installation') yield path - except FileNotFoundException: + except FileNotFoundError: print("No Micro-Manager installation found, installing now") # Download an install latest nightly build mm_install_dir = download_and_install_mm(destination='auto')