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

Commit a50d30f

Browse files
authored
Merge pull request #94 from xdev-software/develop
6.0.3
2 parents 6d08626 + b4e396e commit a50d30f

21 files changed

+880
-619
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/dependabot.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ updates:
2222
open-pull-requests-limit: 10
2323
ignore:
2424
- dependency-name: "org.openjfx:*"
25-
versions: ">=18.x"
25+
versions:
26+
- ">=22.x"

.github/workflows/checkBuild.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ on:
1212
- '**.md'
1313

1414
jobs:
15-
build_lts:
15+
build:
1616
runs-on: ubuntu-latest
1717

1818
strategy:
1919
matrix:
20-
java: [11, 17]
20+
java: [11, 17, 21]
2121
java-package: [jdk]
2222
distribution: [temurin]
2323
include:
@@ -27,10 +27,10 @@ jobs:
2727
distribution: zulu
2828

2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v4
3131

3232
- name: Set up JDK
33-
uses: actions/setup-java@v2
33+
uses: actions/setup-java@v4
3434
with:
3535
distribution: ${{ matrix.distribution }}
3636
java-version: ${{ matrix.java }}
@@ -57,8 +57,9 @@ jobs:
5757
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify"
5858
exit 1
5959
fi
60-
61-
- uses: actions/upload-artifact@v2
60+
61+
- uses: actions/upload-artifact@v3
6262
with:
63-
name: jars-lts-${{ matrix.java }}
63+
name: jars-java-${{ matrix.java }}
6464
path: target/*.jar
65+
if-no-files-found: error

.github/workflows/release.yml

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ on:
44
push:
55
branches: [ master ]
66

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

13-
- name: Set up JDK 8
14-
uses: actions/setup-java@v2
17+
- name: Set up JDK
18+
uses: actions/setup-java@v4
1519
with:
1620
distribution: 'zulu'
1721
java-version: '8'
@@ -45,7 +49,7 @@ jobs:
4549
outputs:
4650
upload_url: ${{ steps.create_draft.outputs.upload_url }}
4751
steps:
48-
- uses: actions/checkout@v2
52+
- uses: actions/checkout@v4
4953

5054
- name: Configure Git
5155
run: |
@@ -57,11 +61,10 @@ jobs:
5761

5862
- name: Get version
5963
id: version
60-
# Ignores the suffix
6164
run: |
62-
read_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
63-
parts=(${read_version//-/ })
64-
echo "::set-output name=release::${parts[0]}"
65+
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
66+
echo "release=$version" >> $GITHUB_OUTPUT
67+
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT
6568
6669
- name: Commit and Push
6770
run: |
@@ -73,32 +76,30 @@ jobs:
7376
7477
- name: Create Release
7578
id: create_release
76-
uses: actions/create-release@v1
77-
env:
78-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
uses: shogo82148/actions-create-release@v1
7980
with:
8081
tag_name: v${{ steps.version.outputs.release }}
8182
release_name: v${{ steps.version.outputs.release }}
8283
commitish: master
8384
body: |
84-
## Installation [![Maven Central](https://img.shields.io/maven-central/v/com.xdev-software/xapi-fx?versionPrefix=${{ steps.version.outputs.release }})](https://mvnrepository.com/artifact/com.xdev-software/xapi-fx)
85+
## [Changelog](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
86+
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.
87+
## Installation
8588
Add the following lines to your pom:
8689
```XML
8790
<dependency>
8891
<groupId>com.xdev-software</groupId>
89-
<artifactId>xapi-fx</artifactId>
90-
<version>${{ steps.version.outputs.release }}-java<JavaVersion></version>
92+
<artifactId>${{ github.event.repository.name }}</artifactId>
93+
<version>${{ steps.version.outputs.release }}</version>
9194
</dependency>
9295
```
93-
draft: false
94-
prerelease: false
9596
9697
publish_central: # Publish the code to central
9798
runs-on: ubuntu-latest
9899
needs: [prepare_release]
99100
strategy:
100101
matrix:
101-
java: [11, 17]
102+
java: [11, 17, 21]
102103
java-package: [jdk]
103104
distribution: [temurin]
104105
include:
@@ -107,22 +108,16 @@ jobs:
107108
java-package: jdk+fx
108109
distribution: zulu
109110
steps:
110-
- uses: actions/checkout@v2
111+
- uses: actions/checkout@v4
111112

112113
- name: Init Git and pull
113114
run: |
114115
git config --global user.email "actions@github.com"
115116
git config --global user.name "GitHub Actions"
116117
git pull
117-
118-
# Fixes OSSRH-66257
119-
# See https://issues.sonatype.org/browse/OSSRH-66257?focusedCommentId=1036973&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1036973
120-
- if: ${{ matrix.java == 17 }}
121-
run: |
122-
echo 'MAVEN_OPTS=--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED' >> $GITHUB_ENV
123118
124-
- name: Set up JDK and configure for ossrh
125-
uses: actions/setup-java@v2
119+
- name: Set up JDK OSSRH
120+
uses: actions/setup-java@v4
126121
with: # running setup-java again overwrites the settings.xml
127122
distribution: ${{ matrix.distribution }}
128123
java-version: ${{ matrix.java }}
@@ -133,29 +128,28 @@ jobs:
133128
gpg-passphrase: MAVEN_GPG_PASSPHRASE
134129
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
135130

136-
- name: Publish to Apache Maven Central
131+
- name: Publish to OSSRH
137132
run: mvn -B deploy -Possrh,java${{ matrix.java }}
138133
env:
139134
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
140135
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
141136
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
142137

143138
publish-pages:
144-
# Java 8-variant has no dependencies
145-
name: Publish dependencies and licenses to github pages (Java 11)
139+
name: Publish dependencies and licenses to github pages
146140
runs-on: ubuntu-latest
147141
needs: [prepare_release]
148142
steps:
149-
- uses: actions/checkout@v2
143+
- uses: actions/checkout@v4
150144

151145
- name: Init Git and pull
152146
run: |
153147
git config --global user.email "actions@github.com"
154148
git config --global user.name "GitHub Actions"
155149
git pull
156150
157-
- name: Set up JDK 11
158-
uses: actions/setup-java@v2
151+
- name: Set up JDK
152+
uses: actions/setup-java@v4
159153
with:
160154
distribution: 'temurin'
161155
java-version: '11'
@@ -165,7 +159,7 @@ jobs:
165159
run: mvn -B project-info-reports:dependencies -Pjava11
166160

167161
- name: Upload licenses - Upload Artifact
168-
uses: actions/upload-artifact@v2
162+
uses: actions/upload-artifact@v3
169163
with:
170164
name: dependencies-licenses
171165
path: target/site
@@ -199,7 +193,7 @@ jobs:
199193
runs-on: ubuntu-latest
200194
needs: [publish_central]
201195
steps:
202-
- uses: actions/checkout@v2
196+
- uses: actions/checkout@v4
203197

204198
- name: Init Git and pull
205199
run: |
@@ -230,9 +224,12 @@ jobs:
230224
git push origin
231225
232226
- name: pull-request
233-
uses: repo-sync/pull-request@v2
234-
with:
235-
github_token: ${{ secrets.GITHUB_TOKEN }}
236-
destination_branch: "develop"
237-
pr_title: "Sync back"
238-
pr_body: "An automated PR to sync changes back"
227+
env:
228+
GH_TOKEN: ${{ github.token }}
229+
run: |
230+
gh_pr_up() {
231+
gh pr create "$@" || gh pr edit "$@"
232+
}
233+
gh_pr_up -B "develop" \
234+
--title "Sync back" \
235+
--body "An automated PR to sync changes back"

.github/workflows/test-deploy.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
name: Test Deployment
1+
name: Test Deployment CI
22

33
on:
44
workflow_dispatch:
55

66
jobs:
77
publish_central: # Publish the code to central
88
runs-on: ubuntu-latest
9-
109
strategy:
1110
matrix:
12-
java: [11, 17]
11+
java: [11, 17, 21]
1312
java-package: [jdk]
1413
distribution: [temurin]
1514
include:
@@ -19,16 +18,10 @@ jobs:
1918
distribution: zulu
2019

2120
steps:
22-
- uses: actions/checkout@v2
23-
24-
# Fixes OSSRH-66257
25-
# See https://issues.sonatype.org/browse/OSSRH-66257?focusedCommentId=1036973&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1036973
26-
- if: ${{ matrix.java == 17 }}
27-
run: |
28-
echo 'MAVEN_OPTS=--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED' >> $GITHUB_ENV
21+
- uses: actions/checkout@v4
2922

30-
- name: Set up JDK and configure for ossrh
31-
uses: actions/setup-java@v2
23+
- name: Set up JDK OSSRH
24+
uses: actions/setup-java@v4
3225
with: # running setup-java again overwrites the settings.xml
3326
distribution: ${{ matrix.distribution }}
3427
java-version: ${{ matrix.java }}
@@ -39,7 +32,7 @@ jobs:
3932
gpg-passphrase: MAVEN_GPG_PASSPHRASE
4033
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
4134

42-
- name: Publish to Apache Maven Central
35+
- name: Publish to OSSRH
4336
run: mvn -B deploy -Possrh,java${{ matrix.java }}
4437
env:
4538
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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@v4
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+
if: steps.main.outputs.abort == 0
85+
env:
86+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
run: |
88+
gh_pr_up() {
89+
gh pr create -H "${{ env.UPDATE_BRANCH }}" "$@" || (git checkout "${{ env.UPDATE_BRANCH }}" && gh pr edit "$@")
90+
}
91+
gh_pr_up -B "${{ steps.main.outputs.current_branch }}" \
92+
--title "Update from template" \
93+
--body "An automated PR to sync changes from the template into this repo"

0 commit comments

Comments
 (0)