-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (116 loc) · 4.02 KB
/
release.yml
File metadata and controls
134 lines (116 loc) · 4.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v1.3.0)'
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # for creating releases
packages: write # for publishing to GitHub Packages
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Get version from tag or input
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
fi
- name: Update version in pom.xml
run: |
VERSION=${{ steps.version.outputs.version }}
VERSION_NO_V=${VERSION#v}
mvn versions:set -DnewVersion=${VERSION_NO_V}
- name: Run tests
run: mvn clean test
- name: Build and publish to GitHub Packages
run: mvn clean deploy -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare release artifacts
run: |
mkdir -p release-artifacts
cp target/convenia-api-client-*.jar release-artifacts/
cp README.md release-artifacts/
cp LICENSE release-artifacts/
if [ -d "examples" ]; then
cp examples/*.xml release-artifacts/ 2>/dev/null || true
fi
- name: Generate checksums
run: |
cd release-artifacts
for file in *.jar; do
sha256sum "$file" > "$file.sha256"
done
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version }}
name: Convenia HR API Client ${{ steps.version.outputs.version }}
files: release-artifacts/*
generate_release_notes: true
draft: false
prerelease: false
body: |
## Convenia HR API Client ${{ steps.version.outputs.version }}
### Installation
#### Option 1: Download JAR
Download the `convenia-api-client-*.jar` file from the assets below.
#### Option 2: Maven Dependency
Add to your `pom.xml`:
```xml
<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/atricore/convenia-api-java</url>
</repository>
</repositories>
<dependency>
<groupId>com.atricore.iam.convenia.api</groupId>
<artifactId>convenia-api-client</artifactId>
<version>${{ steps.version.outputs.version }}</version>
</dependency>
```
Note: GitHub Packages requires authentication. Add your GitHub credentials to `~/.m2/settings.xml`:
```xml
<servers>
<server>
<id>github</id>
<username>YOUR_GITHUB_USERNAME</username>
<password>YOUR_PERSONAL_ACCESS_TOKEN</password>
</server>
</servers>
```
### Compatibility
- Java 11, 17, 21
### Files in this release
- `convenia-api-client-*.jar` - Main connector JAR file
- `README.md` - Documentation
- `LICENSE` - License information
- `*.xml` - Configuration examples (if available)
- `*.sha256` - Checksums for verification
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}