From f05826b3c9ddf15b80056e548e21adea4d766c54 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 20 Feb 2024 12:42:21 +0000 Subject: [PATCH 1/4] use snapshot --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ca08d16..0aacc98 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 ome OMEZarrReader - 0.4.1 + 0.4.2-SNAPSHOT Implementation of Bio-Formats readers for the next-generation file formats 2020 From 8880030122bf50ef83436093cc63c369d4b54ff3 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 20 Feb 2024 12:43:57 +0000 Subject: [PATCH 2/4] bump actions/checkout to v4 --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b49efdb..35eb329 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -18,7 +18,7 @@ jobs: env: maven_commands: install # default is install steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v3 with: @@ -37,7 +37,7 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Retrieve version id: get_version run: | From f6dd00758bdd37669bc1cc7ff29b079548b58c9f Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 20 Feb 2024 12:44:44 +0000 Subject: [PATCH 3/4] bump actions/setup-java to v4 --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 35eb329..ed956ee 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -20,7 +20,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: 'zulu' @@ -52,7 +52,7 @@ jobs: echo server='ome.staging' >> $GITHUB_OUTPUT fi - name: Set up Repository - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 8 distribution: 'zulu' From f83d9e471d199995f43788a9bb2a5e84cef002a8 Mon Sep 17 00:00:00 2001 From: Jean-Marie Burel Date: Tue, 20 Feb 2024 12:52:54 +0000 Subject: [PATCH 4/4] deploy snapshots and on tag --- .github/workflows/maven.yml | 39 +++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index ed956ee..6d32f30 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -32,8 +32,8 @@ jobs: with: name: ZarrReader path: target/*.jar - deploy: - if: contains('refs/heads/main', github.ref) + deploy_snapshots: + if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'ome' }} needs: build runs-on: ubuntu-latest steps: @@ -60,6 +60,41 @@ jobs: server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD - name: Deploy SNAPSHOT + if: ${{ steps.set_server.outputs.server == 'ome.snapshots' }} + run: mvn deploy + env: + MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USER }} + MAVEN_PASSWORD: ${{ secrets.CI_DEPLOY_PASS }} + + deploy_tags: + if: startsWith(github.ref, 'refs/tags') && github.repository_owner == 'ome' + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Retrieve version + id: get_version + run: | + VERSION=$( mvn help:evaluate -Dexpression=project.version -q -DforceStdout ) + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Set server + id: set_server + run: | + if [[ ${{ steps.get_version.outputs.version }} =~ 'SNAPSHOT' ]]; then + echo server='ome.snapshots' >> $GITHUB_OUTPUT + else + echo server='ome.releases' >> $GITHUB_OUTPUT + fi + - name: Set up Repository + uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: 'zulu' + server-id: ${{ steps.set_server.outputs.server }} + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Deploy Tags + if: ${{ steps.set_server.outputs.server == 'ome.releases' }} run: mvn deploy env: MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USER }}