From 9d14b90c725d8d5f4a5325fcb0cbe28b4768cc24 Mon Sep 17 00:00:00 2001 From: Rob Court Date: Fri, 9 Aug 2024 15:42:52 +0100 Subject: [PATCH] Create release.yml --- .github/workflows/release.yml | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f16d0a9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,49 @@ +name: Build and Release JAR + +on: + push: + branches: + - main + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '11' + + - name: Build with Maven + run: mvn clean package + + - name: Archive build artifacts + uses: actions/upload-artifact@v3 + with: + name: neo4j2owl-jar + path: target/*.jar + + release: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'release' + + steps: + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: neo4j2owl-jar + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + files: neo4j2owl-jar/*.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}