-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (83 loc) · 3.09 KB
/
Copy pathrelease.yml
File metadata and controls
99 lines (83 loc) · 3.09 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
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
- name: Cache SBT
uses: actions/cache@v4
with:
path: |
~/.sbt
~/.ivy2/cache
~/.coursier/cache
key: sbt-${{ runner.os }}-${{ hashFiles('**/*.sbt', '**/build.properties', '**/plugins.sbt') }}
restore-keys: |
sbt-${{ runner.os }}-
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.PGP_SECRET }}
passphrase: ${{ secrets.PGP_PASSPHRASE }}
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update version in build.sbt
run: |
sed -i 's/version := ".*"/version := "${{ steps.version.outputs.VERSION }}"/' build.sbt
cat build.sbt | grep version
- name: Build and test all Scala versions
run: sbt +clean +compile +test
- name: Publish to Maven Central
run: sbt +publishSigned sonatypeBundleRelease
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.version.outputs.VERSION }}
body: |
## OBP Scala Library ${{ steps.version.outputs.VERSION }}
### Maven Usage
```xml
<dependency>
<groupId>com.openbankproject</groupId>
<artifactId>obp-scala-library_2.13</artifactId>
<version>${{ steps.version.outputs.VERSION }}</version>
</dependency>
```
### SBT Usage
```scala
libraryDependencies += "com.openbankproject" %% "obp-scala-library" % "${{ steps.version.outputs.VERSION }}"
```
### Supported Scala Versions
- Scala 2.12.17
- Scala 2.13.14
- Scala 3.3.1
Published to Maven Central: https://central.sonatype.com/artifact/com.openbankproject/obp-scala-library_2.13/${{ steps.version.outputs.VERSION }}
draft: false
prerelease: false
- name: Notify success
if: success()
run: |
echo "✅ Successfully published OBP Scala Library ${{ steps.version.outputs.VERSION }} to Maven Central"
echo "📦 Artifacts available at: https://central.sonatype.com/artifact/com.openbankproject/obp-scala-library_2.13/${{ steps.version.outputs.VERSION }}"