Skip to content

Commit

Permalink
Merge pull request #80 from jburel/review_action
Browse files Browse the repository at this point in the history
Review action
  • Loading branch information
jburel authored Mar 18, 2024
2 parents cf4f3f2 + f83d9e4 commit 986020e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
47 changes: 41 additions & 6 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ 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
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
Expand All @@ -32,12 +32,12 @@ 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:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Retrieve version
id: get_version
run: |
Expand All @@ -52,14 +52,49 @@ 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'
server-id: ${{ steps.set_server.outputs.server }}
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 }}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ome</groupId>
<artifactId>OMEZarrReader</artifactId>
<version>0.4.1</version>
<version>0.4.2-SNAPSHOT</version>

<name>Implementation of Bio-Formats readers for the next-generation file formats</name>
<inceptionYear>2020</inceptionYear>
Expand Down

0 comments on commit 986020e

Please sign in to comment.