-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (97 loc) · 3.39 KB
/
Copy pathmain.yml
File metadata and controls
113 lines (97 loc) · 3.39 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
name: CD-CI
on:
push:
branches: [ main ]
jobs:
build:
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pusher.email != 'version-bump@flossware.org'
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Updating runner
run: sudo apt-get update
- name: Setup JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Checkout
uses: actions/checkout@v4
- name: Preparing settings.xml
uses: s4u/maven-settings-action@v3.1.0
with:
githubServer: false
servers: |
[
{
"id": "packagecloud-flossware",
"configuration": {
"httpHeaders": {
"property": {
"name": "Authorization",
"value": "Bearer ${{ secrets.PACKAGECLOUD_TOKEN }}"
}
}
}
}
]
- name: Setup .gitconfig for version bumps
uses: oleksiyrudenko/gha-git-credentials@latest
with:
global: true
name: 'Version Bump'
email: 'version-bump@flossware.org'
actor: 'VersionBump'
token: '${{ secrets.GITHUB_TOKEN }}'
- name: Incrementing pom.xml version
run: "mvn -U build-helper:parse-version versions:set -DnewVersion=\\${parsedVersion.majorVersion}.\\${parsedVersion.nextMinorVersion} versions:commit"
- name: Ensure latest dependencies in pom.xml
run: "mvn -Dincludes='org.junit.jupiter:*' -DgenerateBackupPoms=false versions:update-properties"
- name: Building and Testing
run: "mvn -U clean install"
- name: Verify build success
run: |
if [ ! -d jplatform-api/target ] || [ ! -d jplatform-core/target ]; then
echo "Build failed - artifacts not found"
exit 1
fi
echo "Build succeeded - deploying to packagecloud.io"
- name: Deploy to packagecloud.io
run: "mvn -DskipTests deploy"
- name: Generate Changelog
id: changelog
uses: TriPSs/conventional-changelog-action@v5.0.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
input-file: 'CHANGELOG.md'
output-file: 'CHANGELOG.md'
release-count: 0
skip-commit: true
skip-on-empty: true
git-branch: main
tag-prefix: 'v'
create-summary: true
- name: Validate Changelog Format
run: |
if [ ! -f CHANGELOG.md ]; then
echo "Error: CHANGELOG.md file not found"
exit 1
fi
echo "✓ Changelog file exists"
head -20 CHANGELOG.md
- name: Commit Changelog Updates
run: |
git add CHANGELOG.md
if ! git diff --cached --quiet; then
echo "Changelog changes detected, committing..."
git commit -m "docs: auto-generate changelog from conventional commits [skip ci]"
git push origin main || {
echo "Warning: Failed to push changelog. May retry on next run."
exit 0
}
else
echo "No changelog changes detected"
fi
- name: Checkin and tag to github
run: "mvn scm:checkin scm:tag"