-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 1.25 KB
/
ci.yml
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
name: ci
on:
workflow_dispatch:
push:
jobs:
build:
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Build with Maven
run: mvn clean verify
- name: Publish Test Report
if: success() || failure()
uses: scacap/action-surefire-report@v1
release:
runs-on: ubuntu-latest
needs: [build]
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Publish package [on main]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn versions:set -DnewVersion=1.0.${{ github.run_number }}
mvn deploy -DskipTests -Denv=mysql
- uses: actions/delete-package-versions@v5
with:
package-name: 'com.github.binpastes.backend'
package-type: 'maven'
min-versions-to-keep: 3