generated from javalin/javalin-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
171 lines (153 loc) · 5.48 KB
/
main.yaml
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Test all JDKs on all OSes and Publish
on: [push, pull_request]
permissions: write-all
jobs:
test:
runs-on: ${{ matrix.os }}
name: "🧪 Test"
strategy:
fail-fast: false
matrix:
java_version: [11, 17, 18] # Test all LTS releases and the latest one
os: [windows-latest, macOS-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
- name: Validate Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup and Run Gradle
uses: gradle/[email protected]
with:
arguments: check
coverage:
runs-on: ubuntu-latest
needs:
- test
name: "📄 Codecov Report"
strategy:
matrix:
test-type: [unit, integration]
steps:
- name: Setup Java JDK
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
- name: Checkout Code
uses: actions/checkout@v3
- name: Validate Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup and Run Gradle
uses: gradle/[email protected]
with:
arguments: ${{ matrix.test-type }}TestsCoverageReport
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
files: "${{ github.workspace }}/build/reports/jacoco/${{ matrix.test-type }}TestsCoverageReport/${{ matrix.test-type }}TestsCoverageReport.xml"
flags: "${{ matrix.test-type }}Tests"
verbose: true
token: "${{ secrets.CODECOV_TOKEN }}"
publish:
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && github.repository == 'javalin/javalin-ssl'
needs:
- test
name: "🛫 Publish to maven repo"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: '17'
- name: Generate version
uses: HardNorth/[email protected]
with:
version-source: file
version-file: build.gradle
version-file-extraction-pattern: '(?<=version\s*=\s*'')\S+(?='')'
- name: Validate Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Publish to Reposilite
uses: gradle/[email protected]
env:
MAVEN_NAME: '${{ secrets.MAVEN_NAME }}'
MAVEN_TOKEN: '${{ secrets.MAVEN_TOKEN }}'
ORG_GRADLE_PROJECT_signingKey: '${{ secrets.GPG_KEY }}'
ORG_GRADLE_PROJECT_signingPassword: '${{ secrets.GPG_PASSPHRASE }}'
ORG_GRADLE_PROJECT_signingKeyId: '${{ secrets.GPG_KEYID }}'
with:
arguments: publishMavenPublicationToReposiliteRepository
- name: Publish to Maven Central
if: "!contains(env.CURRENT_VERSION, 'SNAPSHOT')"
uses: gradle/[email protected]
env:
ORG_GRADLE_PROJECT_sonatypeUsername: '${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }}'
ORG_GRADLE_PROJECT_sonatypePassword: '${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }}'
ORG_GRADLE_PROJECT_signingKey: '${{ secrets.GPG_KEY }}'
ORG_GRADLE_PROJECT_signingPassword: '${{ secrets.GPG_PASSPHRASE }}'
ORG_GRADLE_PROJECT_signingKeyId: '${{ secrets.GPG_KEYID }}'
with:
arguments: publishToSonatype closeAndReleaseStagingRepository
- name: Create Pre-Release
if: contains(env.CURRENT_VERSION, 'SNAPSHOT')
uses: ncipollo/[email protected]
with:
tag: ${{ env.CURRENT_VERSION }}
generateReleaseNotes: true
commit: main
prerelease: true
body: |
## Download Instructions
### Maven
```xml
<repository>
<id>reposilite-repository-snapshots</id>
<name>Reposilite Repository</name>
<url>https://maven.reposilite.com/snapshots</url>
</repository>
```
```xml
<dependency>
<groupId>io.javalin.community.ssl</groupId>
<artifactId>ssl-plugin</artifactId>
<version>${{ env.CURRENT_VERSION }}</version>
</dependency>
```
### Gradle
```groovy
maven {
url "https://maven.reposilite.com/snapshots"
}
```
```groovy
implementation('io.javalin.community.ssl:ssl-plugin:${{ env.CURRENT_VERSION }}')
```
- name: Create Release
if: "!contains(env.CURRENT_VERSION, 'SNAPSHOT')"
uses: ncipollo/[email protected]
with:
tag: ${{ env.CURRENT_VERSION }}
generateReleaseNotes: true
commit: main
body: |
## Download Instructions
### Maven
```xml
<dependency>
<groupId>io.javalin.community.ssl</groupId>
<artifactId>ssl-plugin</artifactId>
<version>${{ env.CURRENT_VERSION }}</version>
</dependency>
```
### Gradle
```groovy
implementation('io.javalin.community.ssl:ssl-plugin:${{ env.CURRENT_VERSION }}')
```