Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Release to GitHub

on:
release:
types: [published]

permissions:
contents: write

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'

- name: Extract version from tag
id: vars
run: |
TAG_NAME=${GITHUB_REF##*/}
if [[ ! "$TAG_NAME" =~ ^v[0-9]+(\.[0-9]+)*$ ]]; then
echo "Invalid tag format: $TAG_NAME"
exit 1
fi
VERSION=${TAG_NAME#v}
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Build JAR
run: mvn -B clean package -DskipTests=true -Drevision=${{ steps.vars.outputs.version }}

- name: Upload JAR to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: target/owlapi-wrapper-${{ steps.vars.outputs.version }}.jar
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>org.stanford.ncbo.oapiwrapper</groupId>
<artifactId>owlapi-wrapper</artifactId>
<version>1.4.3-SNAPSHOT</version>
<version>${revision}</version>
<packaging>jar</packaging>

<name>owlapi_wrapper</name>
Expand Down Expand Up @@ -99,6 +99,7 @@
</issueManagement>

<properties>
<revision>1.4.3-SNAPSHOT</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down Expand Up @@ -217,11 +218,14 @@
</executions>
</plugin>

<!-- Commented out: we use Git tag–driven releases instead -->
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
</plugin>
-->

<plugin>
<groupId>org.jacoco</groupId>
Expand Down