Skip to content

Commit

Permalink
Merge pull request #3 from protegeproject/separate-out-workflows
Browse files Browse the repository at this point in the history
Refactored workflows
  • Loading branch information
matthewhorridge authored Jun 4, 2024
2 parents cd2543e + c611693 commit 50c9e6f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 31 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Java CI

on: [push]
on:
push:
branches-ignore:
- main

jobs:
build:
Expand All @@ -10,31 +13,10 @@ jobs:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}}
gpg-passphrase: GPG_PASSPHRASE
- name: Bump version
id: bump
uses: mickem/gh-action-bump-maven-version@v1
- name: Build with Maven
run: mvn --batch-mode -Prelease deploy
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump.outputs.tag }}
generate_release_notes: true

env:
GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}}
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}
run: mvn --batch-mode verify
40 changes: 32 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,43 @@
name: Main
name: Java CI

on:
push:
tags:
- "*.*.*"
workflow_dispatch:

branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_TOKEN
gpg-private-key: ${{secrets.GPG_PRIVATE_KEY}}
gpg-passphrase: GPG_PASSPHRASE
- name: Bump version
id: bump
uses: mickem/gh-action-bump-maven-version@v1
- name: Build with Maven
run: mvn --batch-mode -Prelease deploy
- name: Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.bump.outputs.tag }}
generate_release_notes: true

env:
GPG_PASSPHRASE: ${{secrets.GPG_PASSPHRASE}}
OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}}
OSSRH_TOKEN: ${{secrets.OSSRH_TOKEN}}

0 comments on commit 50c9e6f

Please sign in to comment.