Skip to content

Commit 061fd62

Browse files
authored
Merge pull request #15 from curityio/feat/master/add-github-action
Add GitHub Action
2 parents a0770a7 + 4082bb7 commit 061fd62

File tree

3 files changed

+126
-28
lines changed

3 files changed

+126
-28
lines changed

.github/workflows/publish.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Make a release and push to nexus
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
release:
6+
type: boolean
7+
description: Make a GitHub release
8+
default: true
9+
publish:
10+
type: boolean
11+
description: Publish to Nexus
12+
default: false
13+
14+
jobs:
15+
package:
16+
name: Build Package
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
23+
- name: Set up JDK 21
24+
uses: actions/setup-java@v4
25+
with:
26+
java-version: '21'
27+
distribution: 'temurin'
28+
cache: 'maven'
29+
30+
- name: Package the plugin
31+
run: mvn package
32+
33+
- name: Build plugin artifacts zip
34+
run: |
35+
zip --junk-paths plugin-artifacts target/*.jar
36+
37+
- name: Upload plugin artifacts
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: plugin-artifacts.zip
41+
path: plugin-artifacts.zip
42+
43+
make_release:
44+
runs-on: ubuntu-latest
45+
needs: package
46+
permissions: write-all
47+
if: ${{ github.event.inputs.release == 'true'}}
48+
steps:
49+
- name: Download code
50+
uses: actions/checkout@v3
51+
52+
- name: Conventional changelog action
53+
id: changelog
54+
uses: TriPSs/conventional-changelog-action@v5
55+
with:
56+
github-token: ${{ secrets.GITHUB_TOKEN }}
57+
skip-version-file: "true"
58+
skip-on-empty: "false"
59+
skip-tag: "true"
60+
skip-commit: "true"
61+
62+
- name: Fetch release version from build gradle file
63+
run: |
64+
echo "RELEASE_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
65+
66+
- name: Download plugin artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: plugin-artifacts.zip
70+
71+
- name: Create release
72+
id: create_release
73+
uses: actions/create-release@v1
74+
if: ${{ steps.changelog.outputs.skipped == 'false' }}
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
with:
78+
tag_name: ${{ env.RELEASE_VERSION }}
79+
release_name: ${{ env.RELEASE_VERSION }}
80+
body: ${{ steps.changelog.outputs.clean_changelog }}
81+
draft: false
82+
prerelease: false
83+
84+
- name: Upload release asset
85+
id: upload-release-asset
86+
uses: actions/upload-release-asset@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
with:
90+
upload_url: ${{ steps.create_release.outputs.upload_url }}
91+
asset_path: ./plugin-artifacts.zip
92+
asset_name: plugin-artifacts.zip
93+
asset_content_type: application/zip
94+
95+
96+
publish:
97+
name: Publish to Nexus
98+
needs: package
99+
runs-on: ubuntu-latest
100+
if: ${{ github.event.inputs.publish == 'true'}}
101+
steps:
102+
- name: Checkout code
103+
uses: actions/checkout@v4
104+
105+
- name: Set up JDK 21
106+
uses: actions/setup-java@v4
107+
with:
108+
java-version: '21'
109+
distribution: 'temurin'
110+
cache: 'maven'
111+
112+
# Setup Maven with OAuth token
113+
- name: Setup Maven with OAuth
114+
id: setup-maven-oauth
115+
uses: curityio/curity-maven-gh-action@v1
116+
with:
117+
client-secret: ${{ secrets.CURITY_CLI_CLIENT_SECRET }}
118+
119+
- name: Publish package
120+
run: mvn deploy ${{ steps.setup-maven-oauth.outputs.maven-deploy-args }}

pom.xml

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
<groupId>io.curity.identityserver.plugin</groupId>
88
<artifactId>identityserver.plugins.authenticators.username</artifactId>
9-
<version>1.4.2</version>
9+
<version>1.4.3</version>
1010
<packaging>jar</packaging>
1111

1212
<name>Curity Username Authenticator</name>
1313

1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<project.curityVersion>6.0.0</project.curityVersion>
16+
<project.curityVersion>10.7.1</project.curityVersion>
1717
<project.slf4jVersion>1.7.25</project.slf4jVersion>
18-
<project.kotlinVersion>1.3.72</project.kotlinVersion>
19-
<project.hibernateValidatorVersion>5.4.3.Final</project.hibernateValidatorVersion>
18+
<project.kotlinVersion>1.9.23</project.kotlinVersion>
19+
<project.hibernateValidatorVersion>7.0.3.Final</project.hibernateValidatorVersion>
2020
</properties>
2121

2222
<build>
@@ -41,7 +41,7 @@
4141
</execution>
4242
</executions>
4343
<configuration>
44-
<jvmTarget>1.8</jvmTarget>
44+
<jvmTarget>21</jvmTarget>
4545
</configuration>
4646
</plugin>
4747
<plugin>
@@ -80,34 +80,12 @@
8080
<scope>provided</scope>
8181
</dependency>
8282
</dependencies>
83-
84-
<repositories>
85-
<repository>
86-
<id>customer-release-repo</id>
87-
<url>https://hub.curityio.net/repository/customer-release-repo/</url>
88-
<snapshots>
89-
<enabled>false</enabled>
90-
</snapshots>
91-
</repository>
92-
<repository>
93-
<id>customer-snapshot-repo</id>
94-
<url>https://hub.curityio.net/repository/customer-snapshot-repo</url>
95-
<snapshots>
96-
<enabled>true</enabled>
97-
</snapshots>
98-
</repository>
99-
</repositories>
10083

10184
<distributionManagement>
10285
<repository>
10386
<id>customer-release-repo</id>
10487
<name>Curity Nexus Release Repository</name>
10588
<url>https://hub.curityio.net/repository/customer-release-repo/</url>
10689
</repository>
107-
<snapshotRepository>
108-
<id>customer-snapshot-repo</id>
109-
<name>Curity Nexus Snapshot Repository</name>
110-
<url>https://hub.curityio.net/repository/customer-snapshot-repo/</url>
111-
</snapshotRepository>
11290
</distributionManagement>
11391
</project>

src/main/kotlin/io/curity/identityserver/plugin/username/authentication/RequestModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package io.curity.identityserver.plugin.username.authentication
33
import org.hibernate.validator.constraints.NotBlank
44
import se.curity.identityserver.sdk.service.UserPreferenceManager
55
import se.curity.identityserver.sdk.web.Request
6-
import javax.validation.Valid
6+
import jakarta.validation.Valid;
77

88
class RequestModel(request: Request, userPreferenceManager: UserPreferenceManager)
99
{

0 commit comments

Comments
 (0)