Skip to content

Commit

Permalink
RM-4857: added maven-release github action (#1)
Browse files Browse the repository at this point in the history
* RM-4857: added maven-release github action

* Move around "Get from GitHub package repo" and added "Releasing" to README.md

---------

Co-authored-by: Janno Kusman <[email protected]>
  • Loading branch information
mir-jalal and jann0k authored Feb 6, 2025
1 parent 6442404 commit 4577650
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Build cdoc2-auth with CI

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4

with:
java-version: '17'
distribution: 'temurin'
overwrite-settings: true #generate settings.xml
cache: maven
- name: Publish with Maven
run: |
mvn deploy
env:
GITHUB_TOKEN: ${{ github.token }}
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,57 @@ CDOC2 has been tested with JDK 17 and Maven 3.8.8
mvn clean install
```

## Get from GitHub package repo


Configure github package repo access
https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry#authenticating-with-a-personal-access-token

Example `<profile>` section of `settings.xml` for using `cdoc2-auth-token`:
```xml
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/open-eid/cdoc2-auth</url>
</repository>
</repositories>
</profile>
```

Note: When pulling, the package index is based on the organization level, not the repository level.
https://stackoverflow.com/questions/63041402/github-packages-single-maven-repository-for-github-organization

So defining single Maven package repo from `open-eid` is enough for pulling cdoc2-* dependencies.

Use in Maven pom.xml:

```xml
<dependency>
<groupId>ee.cyber.cdoc2</groupId>
<artifactId>cdoc2-auth-token</artifactId>
<version>0.3.3-SNAPSHOT</version>
</dependency>
```

## Releasing

### Versioning

cdoc2-auth uses [semantic versioning](https://semver.org/).

### GitHub release

[Create release](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository#creating-a-release).
It will trigger `maven-release.yml` workflow that will deploy Maven packages to GitHub Maven package repository
and build & publish maven packages.



## cdoc2.auth-token.v1 examples

Expand Down Expand Up @@ -126,3 +177,4 @@ Other rules to validate auth ticket:
[Verifying SD-JWT (verifying authentication ticket)](https://open-eid.github.io/CDOC2/2.0-Draft/03_system_architecture/ch05_ID_authentication_protocol/#verifying-sd-jwt-verifying-authentication-ticket)

For additional details see tests in `src/test/java/`

0 comments on commit 4577650

Please sign in to comment.