Skip to content

Commit

Permalink
Merge pull request ome#3990 from jburel/release_point
Browse files Browse the repository at this point in the history
Point to Release
  • Loading branch information
dgault authored May 1, 2023
2 parents 6ac604b + cf67ada commit 5f06be9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 7 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,43 @@ jobs:
cache: 'maven'
- name: Build
run: mvn ${{ env.maven_commands }}
deploy:
deploy_snapshots:
if: ${{ github.ref == 'refs/heads/develop' && github.repository_owner == 'ome' }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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 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@v2
- name: Retrieve version
Expand All @@ -55,7 +88,8 @@ jobs:
server-id: ${{ steps.set_server.outputs.server }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Deploy SNAPSHOT
- name: Deploy Tags
if: ${{ steps.set_server.outputs.server == 'ome.releases' }}
run: mvn deploy
env:
MAVEN_USERNAME: ${{ secrets.CI_DEPLOY_USER }}
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -474,16 +474,16 @@
</pluginRepositories>

<distributionManagement>
<repository>
<id>ome.staging</id>
<name>OME Staging Repository</name>
<url>https://artifacts.openmicroscopy.org/artifactory/ome.staging</url>
</repository>
<snapshotRepository>
<id>ome.snapshots</id>
<name>OME Snapshots Repository</name>
<url>https://artifacts.openmicroscopy.org/artifactory/ome.snapshots</url>
</snapshotRepository>
<repository>
<id>ome.releases</id>
<name>OME Releases Repository</name>
<url>https://artifacts.openmicroscopy.org/artifactory/ome.releases</url>
</repository>
</distributionManagement>

<profiles>
Expand Down

0 comments on commit 5f06be9

Please sign in to comment.