Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.

Commit 247d841

Browse files
authored
Merge pull request #77 from xdev-software/develop
6.0.2
2 parents a83ff70 + 8bca35e commit 247d841

File tree

216 files changed

+3396
-4215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+3396
-4215
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/checkBuild.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@ jobs:
1717

1818
strategy:
1919
matrix:
20-
java: [8, 11, 17]
20+
java: [8, 11, 17]
2121
java-package: [jdk]
2222
distribution: [temurin]
2323

2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626

2727
- name: Set up JDK
28-
uses: actions/setup-java@v2
28+
uses: actions/setup-java@v3
2929
with:
3030
distribution: ${{ matrix.distribution }}
3131
java-version: ${{ matrix.java }}
3232
java-package: ${{ matrix.java-package }}
3333
cache: 'maven'
34-
server-id: xdevjfrog
35-
server-username: JFROG_ARTIFACTORY_USERNAME # env variable name for username of Artifactory server
36-
server-password: JFROG_ARTIFACTORY_TOKEN # env variable name for Artifactory access token
34+
server-id: proprietary-xdev-dependencies
35+
server-username: GH_PACKAGES_READ_USERNAME # env variable name for username of Artifactory server
36+
server-password: GH_PACKAGES_READ_TOKEN # env variable name for Artifactory access token
3737

3838
- name: Build with Maven
3939
run: mvn -B clean verify
4040
env:
41-
JFROG_ARTIFACTORY_USERNAME: ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
42-
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
41+
GH_PACKAGES_READ_USERNAME: ${{ secrets.GH_PACKAGES_READ_USERNAME }}
42+
GH_PACKAGES_READ_TOKEN: ${{ secrets.GH_PACKAGES_READ_TOKEN }}
4343

4444
- name: Check for uncommited changes
4545
run: |
@@ -59,7 +59,8 @@ jobs:
5959
exit 1
6060
fi
6161
62-
- uses: actions/upload-artifact@v2
62+
- uses: actions/upload-artifact@v3
6363
with:
6464
name: jars-java-${{ matrix.java }}
6565
path: target/*.jar
66+
if-no-files-found: error

.github/workflows/maven/m2-settings-release.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
<passphrase>${env.MAVEN_GPG_PASSPHRASE}</passphrase>
1313
</server>
1414
<server>
15-
<id>xdevjfrog</id>
16-
<username>${env.JFROG_ARTIFACTORY_USERNAME}</username>
17-
<password>${env.JFROG_ARTIFACTORY_TOKEN}</password>
15+
<id>proprietary-xdev-dependencies</id>
16+
<username>${env.GH_PACKAGES_READ_USERNAME}</username>
17+
<password>${env.GH_PACKAGES_READ_TOKEN}</password>
1818
</server>
1919
</servers>
20-
</settings>
20+
</settings>

.github/workflows/release.yml

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,31 @@ on:
44
push:
55
branches: [ master ]
66

7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
711
jobs:
8-
check_code: # Validates the code (see develop.yml)
12+
check_code: # Validates the code (see checkBuild.yml)
913
runs-on: ubuntu-latest
1014
steps:
11-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1216

13-
- name: Set up JDK 8
14-
uses: actions/setup-java@v2
17+
- name: Set up JDK
18+
uses: actions/setup-java@v3
1519
with:
1620
distribution: 'temurin'
1721
java-version: '8'
1822
cache: 'maven'
19-
server-id: xdevjfrog
20-
server-username: JFROG_ARTIFACTORY_USERNAME # env variable name for username of Artifactory server
21-
server-password: JFROG_ARTIFACTORY_TOKEN # env variable name for Artifactory access token
23+
server-id: proprietary-xdev-dependencies
24+
server-username: GH_PACKAGES_READ_USERNAME # env variable name for username of Artifactory server
25+
server-password: GH_PACKAGES_READ_TOKEN # env variable name for Artifactory access token
2226

2327
- name: Build with Maven
2428
run: mvn -B clean verify
2529
env:
26-
JFROG_ARTIFACTORY_USERNAME: ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
27-
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
30+
GH_PACKAGES_READ_USERNAME: ${{ secrets.GH_PACKAGES_READ_USERNAME }}
31+
GH_PACKAGES_READ_TOKEN: ${{ secrets.GH_PACKAGES_READ_TOKEN }}
2832

2933
- name: Check for uncommited changes
3034
run: |
@@ -50,7 +54,7 @@ jobs:
5054
outputs:
5155
upload_url: ${{ steps.create_draft.outputs.upload_url }}
5256
steps:
53-
- uses: actions/checkout@v2
57+
- uses: actions/checkout@v3
5458

5559
- name: Configure Git
5660
run: |
@@ -63,7 +67,9 @@ jobs:
6367
- name: Get version
6468
id: version
6569
run: |
66-
echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
70+
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
71+
echo "release=$version" >> $GITHUB_OUTPUT
72+
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
6773
6874
- name: Commit and Push
6975
run: |
@@ -75,40 +81,38 @@ jobs:
7581
7682
- name: Create Release
7783
id: create_release
78-
uses: actions/create-release@v1
79-
env:
80-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
uses: shogo82148/actions-create-release@v1
8185
with:
8286
tag_name: v${{ steps.version.outputs.release }}
8387
release_name: v${{ steps.version.outputs.release }}
8488
commitish: master
8589
body: |
86-
## Installation [![Maven Central](https://img.shields.io/maven-central/v/com.xdev-software/csapi?versionPrefix=${{ steps.version.outputs.release }})](https://mvnrepository.com/artifact/com.xdev-software/csapi)
90+
## [Changelog](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
91+
See [Changelog#v${{ steps.version.outputs.release }}](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }}) for more information.
92+
## Installation
8793
Add the following lines to your pom:
8894
```XML
8995
<dependency>
9096
<groupId>com.xdev-software</groupId>
91-
<artifactId>csapi</artifactId>
97+
<artifactId>${{ github.event.repository.name }}</artifactId>
9298
<version>${{ steps.version.outputs.release }}</version>
9399
</dependency>
94100
```
95-
draft: false
96-
prerelease: false
97101
98102
publish_central: # Publish the code to central
99103
runs-on: ubuntu-latest
100104
needs: [prepare_release]
101105
steps:
102-
- uses: actions/checkout@v2
106+
- uses: actions/checkout@v3
103107

104108
- name: Init Git and pull
105109
run: |
106110
git config --global user.email "actions@github.com"
107111
git config --global user.name "GitHub Actions"
108112
git pull
109113
110-
- name: Set up JDK 8 OSSRH
111-
uses: actions/setup-java@v2
114+
- name: Set up JDK OSSRH
115+
uses: actions/setup-java@v3
112116
with: # running setup-java again overwrites the settings.xml
113117
distribution: 'temurin'
114118
java-version: '8'
@@ -120,7 +124,7 @@ jobs:
120124
# Due to https://github.com/actions/setup-java/issues/85 we can only
121125
# add ONE server using setup-java...
122126
overwrite-settings: false
123-
127+
124128
# ... so let's simply copy a predefined settings.xml file into the m2 folder
125129
# until GH makes it work
126130
- name: Copy predefined settings into home m2 folder
@@ -131,8 +135,8 @@ jobs:
131135
- name: Publish to OSSRH
132136
run: mvn -B deploy -Pxdev-build,ossrh
133137
env:
134-
JFROG_ARTIFACTORY_USERNAME: ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
135-
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
138+
GH_PACKAGES_READ_USERNAME: ${{ secrets.GH_PACKAGES_READ_USERNAME }}
139+
GH_PACKAGES_READ_TOKEN: ${{ secrets.GH_PACKAGES_READ_TOKEN }}
136140
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
137141
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
138142
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
@@ -142,31 +146,31 @@ jobs:
142146
runs-on: ubuntu-latest
143147
needs: [prepare_release]
144148
steps:
145-
- uses: actions/checkout@v2
149+
- uses: actions/checkout@v3
146150

147151
- name: Init Git and pull
148152
run: |
149153
git config --global user.email "actions@github.com"
150154
git config --global user.name "GitHub Actions"
151155
git pull
152156
153-
- name: Set up JDK 8
154-
uses: actions/setup-java@v2
157+
- name: Set up JDK
158+
uses: actions/setup-java@v3
155159
with:
156160
distribution: 'temurin'
157161
java-version: '8'
158-
server-id: xdevjfrog
159-
server-username: JFROG_ARTIFACTORY_USERNAME # env variable name for username of Artifactory server
160-
server-password: JFROG_ARTIFACTORY_TOKEN # env variable name for Artifactory access token
162+
server-id: proprietary-xdev-dependencies
163+
server-username: GH_PACKAGES_READ_USERNAME # env variable name for username of Artifactory server
164+
server-password: GH_PACKAGES_READ_TOKEN # env variable name for Artifactory access token
161165

162166
- name: Build dependencies/licenses files
163167
run: mvn -B project-info-reports:dependencies
164168
env:
165-
JFROG_ARTIFACTORY_USERNAME: ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
166-
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
169+
GH_PACKAGES_READ_USERNAME: ${{ secrets.GH_PACKAGES_READ_USERNAME }}
170+
GH_PACKAGES_READ_TOKEN: ${{ secrets.GH_PACKAGES_READ_TOKEN }}
167171

168172
- name: Upload licenses - Upload Artifact
169-
uses: actions/upload-artifact@v2
173+
uses: actions/upload-artifact@v3
170174
with:
171175
name: dependencies-licenses
172176
path: target/site
@@ -200,7 +204,7 @@ jobs:
200204
runs-on: ubuntu-latest
201205
needs: [publish_central]
202206
steps:
203-
- uses: actions/checkout@v2
207+
- uses: actions/checkout@v3
204208

205209
- name: Init Git and pull
206210
run: |
@@ -220,7 +224,6 @@ jobs:
220224
- name: pull-request
221225
uses: repo-sync/pull-request@v2
222226
with:
223-
github_token: ${{ secrets.GITHUB_TOKEN }}
224227
destination_branch: "develop"
225228
pr_title: "Sync back"
226229
pr_body: "An automated PR to sync changes back"

.github/workflows/test-deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
publish_central: # Publish the code to central
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111

12-
- name: Set up JDK 8 OSSRH
13-
uses: actions/setup-java@v2
12+
- name: Set up JDK OSSRH
13+
uses: actions/setup-java@v3
1414
with: # running setup-java again overwrites the settings.xml
1515
distribution: 'temurin'
1616
java-version: '8'
@@ -22,7 +22,7 @@ jobs:
2222
# Due to https://github.com/actions/setup-java/issues/85 we can only
2323
# add ONE server using setup-java...
2424
overwrite-settings: false
25-
25+
2626
# ... so let's simply copy a predefined settings.xml file into the m2 folder
2727
# until GH makes it work
2828
- name: Copy predefined settings into home m2 folder
@@ -33,8 +33,8 @@ jobs:
3333
- name: Publish to OSSRH
3434
run: mvn -B deploy -Pxdev-build,ossrh
3535
env:
36-
JFROG_ARTIFACTORY_USERNAME: ${{ secrets.JFROG_ARTIFACTORY_USERNAME }}
37-
JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }}
36+
GH_PACKAGES_READ_USERNAME: ${{ secrets.GH_PACKAGES_READ_USERNAME }}
37+
GH_PACKAGES_READ_TOKEN: ${{ secrets.GH_PACKAGES_READ_TOKEN }}
3838
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
3939
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
4040
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Update from Template
2+
3+
# This workflow keeps the repo up to date with changes from the template repo (REMOTE_URL)
4+
# It duplicates the REMOTE_BRANCH (into UPDATE_BRANCH) and tries to merge it into the
5+
# this repos default branch (which is checked out here)
6+
# Note that this requires a PAT (Personal Access Token) - at best from a servicing account
7+
# Also note that you should have at least once merged the template repo into the current repo manually
8+
# otherwise a "refusing to merge unrelated histories" error might occur.
9+
10+
on:
11+
schedule:
12+
- cron: '55 2 * * 1'
13+
workflow_dispatch:
14+
15+
env:
16+
UPDATE_BRANCH: update-from-template
17+
REMOTE_URL: https://github.com/xdev-software/xdev-swing-framework-template.git
18+
REMOTE_BRANCH: master
19+
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
24+
jobs:
25+
update:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v3
30+
with:
31+
# Required because otherwise there are always changes detected when executing diff/rev-list
32+
fetch-depth: 0
33+
# If no PAT is used the following error occurs on a push:
34+
# refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission
35+
token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}
36+
37+
- name: Init Git
38+
run: |
39+
git config --global user.email "actions@github.com"
40+
git config --global user.name "GitHub Actions"
41+
42+
- name: Main workflow
43+
id: main
44+
run: |
45+
echo "Adding remote template-repo"
46+
git remote add template ${{ env.REMOTE_URL }}
47+
48+
echo "Fetching remote template repo"
49+
git fetch template
50+
51+
echo "Deleting local branch that will contain the updates - if present"
52+
git branch -D ${{ env.UPDATE_BRANCH }} || true
53+
54+
echo "Checking if the remote template repo has new commits"
55+
git rev-list ..template/${{ env.REMOTE_BRANCH }}
56+
57+
if [ $(git rev-list --count ..template/${{ env.REMOTE_BRANCH }}) -eq 0 ]; then
58+
echo "There are no commits new commits on the template repo"
59+
60+
echo "Deleting origin branch that contains the updates - if present"
61+
git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true
62+
63+
echo "abort=1" >> $GITHUB_OUTPUT
64+
exit 0
65+
fi
66+
67+
echo "Found new commits on the template repo"
68+
69+
echo "Creating update branch"
70+
git branch ${{ env.UPDATE_BRANCH }} template/${{ env.REMOTE_BRANCH }}
71+
git branch --unset-upstream ${{ env.UPDATE_BRANCH }}
72+
73+
echo "Pushing update branch"
74+
git push -f -u origin ${{ env.UPDATE_BRANCH }}
75+
76+
echo "Getting current branch"
77+
current_branch=$(git branch --show-current)
78+
echo "Current branch is $current_branch"
79+
echo "current_branch=$current_branch" >> $GITHUB_OUTPUT
80+
81+
echo "abort=0" >> $GITHUB_OUTPUT
82+
83+
- name: pull-request
84+
uses: repo-sync/pull-request@v2
85+
if: steps.main.outputs.abort == 0
86+
with:
87+
github_token: ${{ secrets.GITHUB_TOKEN }}
88+
source_branch: ${{ env.UPDATE_BRANCH }}
89+
destination_branch: ${{ steps.main.outputs.current_branch }}
90+
pr_title: "Update from template"
91+
pr_body: "An automated PR to sync changes from the template into this repo"
92+

0 commit comments

Comments
 (0)