Skip to content

Commit 99f48d7

Browse files
committed
add GitHub release workflow and update pom.xml for external versioning
Introduces a new GitHub Actions workflow to publish JARs on release. Updates pom.xml to use externally injected versioning via the ${revision} property, replacing the Maven Release Plugin which is now disabled.
1 parent 419489d commit 99f48d7

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Publish Release to GitHub
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
build-and-release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '11'
21+
distribution: 'temurin'
22+
23+
- name: Extract version from tag
24+
id: vars
25+
run: |
26+
TAG_NAME=${GITHUB_REF##*/}
27+
if [[ ! "$TAG_NAME" =~ ^v[0-9]+(\.[0-9]+)*$ ]]; then
28+
echo "Invalid tag format: $TAG_NAME"
29+
exit 1
30+
fi
31+
VERSION=${TAG_NAME#v}
32+
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
33+
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
34+
35+
- name: Build JAR
36+
run: mvn -B clean package -DskipTests=true -Drevision=${{ steps.vars.outputs.version }}
37+
38+
- name: Upload JAR to GitHub Release
39+
uses: softprops/action-gh-release@v2
40+
with:
41+
files: target/owlapi-wrapper-${{ steps.vars.outputs.version }}.jar
42+
generate_release_notes: true
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+

pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>org.stanford.ncbo.oapiwrapper</groupId>
55
<artifactId>owlapi-wrapper</artifactId>
6-
<version>1.4.3-SNAPSHOT</version>
6+
<version>${revision}</version>
77
<packaging>jar</packaging>
88

99
<name>owlapi_wrapper</name>
@@ -99,6 +99,7 @@
9999
</issueManagement>
100100

101101
<properties>
102+
<revision>1.4.3-SNAPSHOT</revision>
102103
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
103104
</properties>
104105

@@ -217,11 +218,14 @@
217218
</executions>
218219
</plugin>
219220

221+
<!-- Commented out: we use Git tag–driven releases instead -->
222+
<!--
220223
<plugin>
221224
<groupId>org.apache.maven.plugins</groupId>
222225
<artifactId>maven-release-plugin</artifactId>
223226
<version>2.5.3</version>
224227
</plugin>
228+
-->
225229

226230
<plugin>
227231
<groupId>org.jacoco</groupId>

0 commit comments

Comments
 (0)