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

Commit a203b45

Browse files
authored
Merge pull request #12 from xdev-software/develop
Release v6.0.0
2 parents a57e157 + 18083b8 commit a203b45

8 files changed

Lines changed: 443 additions & 13 deletions

File tree

.github/dependabot.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
# Run it at a specific time so that we don't get emails all day long
8+
time: "00:00"
9+
open-pull-requests-limit: 10
10+
ignore:
11+
- dependency-name: "*"
12+
# GitHub actions are using git tags (v1 = v1.2 = v1.2.3) which should be compatible until a major change is performed
13+
update-types:
14+
- "version-update:semver-minor"
15+
- "version-update:semver-patch"
16+
- package-ecosystem: maven
17+
directory: "/"
18+
schedule:
19+
interval: daily
20+
# Run it at a specific time so that we don't get emails all day long
21+
time: "00:00"
22+
open-pull-requests-limit: 10

.github/workflows/checkBuild.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Check Build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ develop ]
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
branches: [ develop ]
11+
paths-ignore:
12+
- '**.md'
13+
14+
jobs:
15+
build_lts:
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
java: [11, 17]
21+
java-package: [jdk]
22+
distribution: [temurin]
23+
include:
24+
# When building Java 8 we need JavaFX on JDK basis
25+
- java: 8
26+
java-package: jdk+fx
27+
distribution: zulu
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Set up JDK
33+
uses: actions/setup-java@v2
34+
with:
35+
distribution: ${{ matrix.distribution }}
36+
java-version: ${{ matrix.java }}
37+
java-package: ${{ matrix.java-package }}
38+
cache: 'maven'
39+
40+
- name: Build with Maven
41+
run: mvn -B clean verify -P java${{ matrix.java }}
42+
43+
- name: Check for uncommited changes
44+
run: |
45+
if [[ "$(git status --porcelain)" != "" ]]; then
46+
echo ----------------------------------------
47+
echo git status
48+
echo ----------------------------------------
49+
git status
50+
echo ----------------------------------------
51+
echo git diff
52+
echo ----------------------------------------
53+
git diff
54+
echo ----------------------------------------
55+
echo Troubleshooting
56+
echo ----------------------------------------
57+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify"
58+
exit 1
59+
fi
60+
61+
- uses: actions/upload-artifact@v2
62+
with:
63+
name: jars-lts-${{ matrix.java }}
64+
path: target/*.jar

.github/workflows/release.yml

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
check_code: # Validates the code (see checkBuild.yml)
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Set up JDK 8
14+
uses: actions/setup-java@v2
15+
with:
16+
distribution: 'zulu'
17+
java-version: '8'
18+
java-package: jdk+fx
19+
cache: 'maven'
20+
21+
- name: Build with Maven
22+
run: mvn -B clean verify -Pjava8
23+
24+
- name: Check for uncommited changes
25+
run: |
26+
if [[ "$(git status --porcelain)" != "" ]]; then
27+
echo ----------------------------------------
28+
echo git status
29+
echo ----------------------------------------
30+
git status
31+
echo ----------------------------------------
32+
echo git diff
33+
echo ----------------------------------------
34+
git diff
35+
echo ----------------------------------------
36+
echo Troubleshooting
37+
echo ----------------------------------------
38+
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify"
39+
exit 1
40+
fi
41+
42+
prepare_release:
43+
runs-on: ubuntu-latest
44+
needs: [check_code]
45+
outputs:
46+
upload_url: ${{ steps.create_draft.outputs.upload_url }}
47+
steps:
48+
- uses: actions/checkout@v2
49+
50+
- name: Configure Git
51+
run: |
52+
git config --global user.email "actions@github.com"
53+
git config --global user.name "GitHub Actions"
54+
55+
- name: Un-SNAP
56+
run: mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false
57+
58+
- name: Get version
59+
id: version
60+
# Ignores the suffix
61+
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+
66+
- name: Commit and Push
67+
run: |
68+
git add -A
69+
git commit -m "Release ${{ steps.version.outputs.release }}"
70+
git push origin
71+
git tag v${{ steps.version.outputs.release }}
72+
git push origin --tags
73+
74+
- name: Create Release
75+
id: create_release
76+
uses: actions/create-release@v1
77+
env:
78+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
79+
with:
80+
tag_name: v${{ steps.version.outputs.release }}
81+
release_name: v${{ steps.version.outputs.release }}
82+
commitish: master
83+
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+
Add the following lines to your pom:
86+
```XML
87+
<dependency>
88+
<groupId>com.xdev-software</groupId>
89+
<artifactId>xapi-fx</artifactId>
90+
<version>${{ steps.version.outputs.release }}-java<JavaVersion></version>
91+
</dependency>
92+
```
93+
draft: false
94+
prerelease: false
95+
96+
publish_central: # Publish the code to central
97+
runs-on: ubuntu-latest
98+
needs: [prepare_release]
99+
strategy:
100+
matrix:
101+
java: [11, 17]
102+
java-package: [jdk]
103+
distribution: [temurin]
104+
include:
105+
# When building Java 8 we need JavaFX on JDK basis
106+
- java: 8
107+
java-package: jdk+fx
108+
distribution: zulu
109+
steps:
110+
- uses: actions/checkout@v2
111+
112+
- name: Init Git and pull
113+
run: |
114+
git config --global user.email "actions@github.com"
115+
git config --global user.name "GitHub Actions"
116+
git pull
117+
118+
- name: Set up JDK and configure for ossrh
119+
uses: actions/setup-java@v2
120+
with: # running setup-java again overwrites the settings.xml
121+
distribution: ${{ matrix.distribution }}
122+
java-version: ${{ matrix.java }}
123+
java-package: ${{ matrix.java-package }}
124+
server-id: ossrh
125+
server-username: MAVEN_CENTRAL_USERNAME
126+
server-password: MAVEN_CENTRAL_TOKEN
127+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
128+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
129+
130+
- name: Publish to Apache Maven Central
131+
run: mvn -B deploy -Possrh,java${{ matrix.java }}
132+
env:
133+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
134+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
135+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
136+
137+
publish-pages:
138+
# Java 8-variant has no dependencies
139+
name: Publish dependencies and licenses to github pages (Java 11)
140+
runs-on: ubuntu-latest
141+
needs: [prepare_release]
142+
steps:
143+
- uses: actions/checkout@v2
144+
145+
- name: Init Git and pull
146+
run: |
147+
git config --global user.email "actions@github.com"
148+
git config --global user.name "GitHub Actions"
149+
git pull
150+
151+
- name: Set up JDK 11
152+
uses: actions/setup-java@v2
153+
with:
154+
distribution: 'temurin'
155+
java-version: '11'
156+
java-package: jdk
157+
158+
- name: Build dependencies/licenses files
159+
run: mvn -B project-info-reports:dependencies -Pjava8
160+
161+
- name: Upload licenses - Upload Artifact
162+
uses: actions/upload-artifact@v2
163+
with:
164+
name: dependencies-licenses
165+
path: target/site
166+
167+
- name: Generate docs/dependencies dir
168+
run: mkdir -p docs/dependencies
169+
170+
- name: Move built files into docs/dependencies
171+
run: mv target/site/* docs/dependencies
172+
173+
- name: Rename dependencies.html to index.html
174+
working-directory: docs/dependencies
175+
run: mv dependencies.html index.html
176+
177+
- name: Copy Readme into docs (as index.md)
178+
run: cp README.md docs/index.md
179+
180+
- name: Configure Pages
181+
working-directory: docs
182+
run: |-
183+
echo "theme: jekyll-theme-tactile" > _config.yml
184+
185+
- name: Deploy to Github pages
186+
uses: peaceiris/actions-gh-pages@v3
187+
with:
188+
github_token: ${{ secrets.GITHUB_TOKEN }}
189+
publish_dir: ./docs
190+
enable_jekyll: true
191+
192+
build_xdev_ide:
193+
runs-on: ubuntu-latest
194+
needs: [prepare_release]
195+
steps:
196+
- uses: actions/checkout@v2
197+
198+
- name: Init Git and pull
199+
run: |
200+
git config --global user.email "actions@github.com"
201+
git config --global user.name "GitHub Actions"
202+
git pull
203+
204+
- name: Set up JDK
205+
uses: actions/setup-java@v2
206+
with:
207+
distribution: 'zulu'
208+
java-version: '8'
209+
java-package: jdk+fx
210+
211+
- name: Cache local Maven repository
212+
uses: actions/cache@v2
213+
with:
214+
path: ~/.m2/repository
215+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
216+
restore-keys: |
217+
${{ runner.os }}-maven-
218+
219+
- name: Build with Maven
220+
run: mvn -B clean verify -Pjava8,xdev-ide
221+
222+
- uses: actions/upload-artifact@v2
223+
with:
224+
name: jars-xdev-ide
225+
path: target/*.jar
226+
227+
after_release:
228+
runs-on: ubuntu-latest
229+
needs: [publish_central, build_xdev_ide]
230+
steps:
231+
- uses: actions/checkout@v2
232+
233+
- name: Init Git and pull
234+
run: |
235+
git config --global user.email "actions@github.com"
236+
git config --global user.name "GitHub Actions"
237+
git pull
238+
239+
- name: Inc Version and SNAP root
240+
# The versions plugin doesn't work that easily with maven so there are some workarounds
241+
run: |
242+
echo "Setting version without suffix"
243+
read_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
244+
parts=(${read_version//-/ })
245+
mvn versions:set -DnewVersion=${parts[0]} -DgenerateBackupPoms=false
246+
247+
echo "Incrementing version and set snapshot"
248+
mvn versions:set -DnextSnapshot=true -DgenerateBackupPoms=false
249+
250+
echo "Set version with suffix"
251+
read_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
252+
parts=(${read_version//-/ })
253+
mvn versions:set -DnewVersion="${parts[0]}-{version.suffix}-${parts[1]}" -DgenerateBackupPoms=false
254+
255+
- name: Git Commit and Push
256+
run: |
257+
git add -A
258+
git commit -m "Preparing for next development iteration"
259+
git push origin
260+
261+
- name: pull-request
262+
uses: repo-sync/pull-request@v2
263+
with:
264+
github_token: ${{ secrets.GITHUB_TOKEN }}
265+
destination_branch: "develop"
266+
pr_title: "Sync back"
267+
pr_body: "An automated PR to sync changes back"

.github/workflows/test-deploy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test Deployment
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
publish_central: # Publish the code to central
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
matrix:
12+
java: [11, 17]
13+
java-package: [jdk]
14+
distribution: [temurin]
15+
include:
16+
# When building Java 8 we need JavaFX on JDK basis
17+
- java: 8
18+
java-package: jdk+fx
19+
distribution: zulu
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Set up JDK and configure for ossrh
25+
uses: actions/setup-java@v2
26+
with: # running setup-java again overwrites the settings.xml
27+
distribution: ${{ matrix.distribution }}
28+
java-version: ${{ matrix.java }}
29+
java-package: ${{ matrix.java-package }}
30+
server-id: ossrh
31+
server-username: MAVEN_CENTRAL_USERNAME
32+
server-password: MAVEN_CENTRAL_TOKEN
33+
gpg-passphrase: MAVEN_GPG_PASSPHRASE
34+
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
35+
36+
- name: Publish to Apache Maven Central
37+
run: mvn -B deploy -Possrh,java${{ matrix.java }}
38+
env:
39+
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
40+
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
41+
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 commit comments

Comments
 (0)