Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Github workflow #26

Merged
merged 2 commits into from
Oct 4, 2024
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
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
dsavelev marked this conversation as resolved.
Show resolved Hide resolved
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