Skip to content

Commit

Permalink
Merge pull request #26 from neondatabase/dsavelev/github-actions
Browse files Browse the repository at this point in the history
Create Github workflow
  • Loading branch information
dsavelev authored Oct 4, 2024
2 parents 237fc4f + 6ae3abd commit 0c40275
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 4 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and create an artifact

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled

jobs:
build_and_test:
name: Build and upload jar package

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'oracle'

- name: Build project with Maven
run: mvn -B package --file pom.xml

- uses: actions/upload-artifact@v4
with:
name: Package
path: target/neon-plugins.jar
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Create release artifact

on:
release:
types:
- published

jobs:
build_and_upload:
name: Build and upload release artifact

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'oracle'

- name: Build project with Maven
run: mvn -B package --file pom.xml

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: 'neon-plugins.jar'
asset_path: 'target/neon-plugins.jar'
asset_content_type: 'application/java-archive'
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ replacing the `<VERSION>` as appropriate

Updated versions of these plugins should be shared via GitHub Releases

you must include the compiled JAR file in the release artifacts, as dependent
projects are expected to download this directly from GitHub as part of their
build pipeline
Github Action will automatically trigger and build a new version of the plugin upon Release.

[1]: https://www.keycloak.org/docs/latest/server_development/index.html#_providers
[1]: https://www.keycloak.org/docs/latest/server_development/index.html#_providers

0 comments on commit 0c40275

Please sign in to comment.