Skip to content

Commit a70d46a

Browse files
authored
UHM-9053 - Move build to GHA and release with Maven release plugin (#153)
1 parent 187932f commit a70d46a

File tree

4 files changed

+66
-5
lines changed

4 files changed

+66
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Deploy Snapshots
2+
3+
on:
4+
push:
5+
branches: [ 'master' ]
6+
workflow_dispatch:
7+
types: [dependency-trigger]
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: 'temurin'
19+
java-version: 8
20+
cache: 'maven'
21+
server-id: central
22+
server-username: SONATYPE_USERNAME
23+
server-password: SONATYPE_PASSWORD
24+
25+
- name: Deploy snapshot
26+
run: mvn -B deploy --file pom.xml
27+
env:
28+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
29+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release new version
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Set up JDK
13+
uses: actions/setup-java@v4
14+
with:
15+
distribution: 'temurin'
16+
java-version: 8
17+
cache: 'maven'
18+
server-id: central
19+
server-username: SONATYPE_USERNAME
20+
server-password: SONATYPE_PASSWORD
21+
22+
# Set up git config
23+
- name: Setup Git Config
24+
run: |
25+
git config user.name "Github Action"
26+
git config user.email "github-action@users.noreply.github.com"
27+
28+
- name: Deploy release
29+
run: mvn -B release:prepare release:perform -Prelease --file pom.xml
30+
env:
31+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
32+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
33+
MAVEN_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }}
34+
MAVEN_GPG_KEY: ${{ secrets.SONATYPE_GPG_PRIVATE_KEY }}
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
name: Build with Maven
1+
name: Verify PRs
22

33
on:
4-
push:
5-
branches: [ master ]
64
pull_request:
7-
branches: [ master ]
85
workflow_dispatch:
96

107
jobs:

content/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<properties>
1212
<pihemrContentGroupId>org.pih.openmrs</pihemrContentGroupId>
1313
<pihemrContentArtifactId>pihemr-content</pihemrContentArtifactId>
14-
<pihemrContentVersion>1.0.0-SNAPSHOT</pihemrContentVersion>
14+
<pihemrContentVersion>1.1.0-SNAPSHOT</pihemrContentVersion>
1515

1616
<parentBuildDir>${project.build.directory}/parent</parentBuildDir>
1717
<childBuildDir>${project.build.directory}/child</childBuildDir>

0 commit comments

Comments
 (0)