Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
48fbc6a
Initial commit
AB-xdev Jan 20, 2023
5d83cce
Setup template with important files
DanielLeinberger Jan 23, 2023
baa3162
Change groupId to software.xdev
DanielLeinberger Jan 23, 2023
5190344
Update groupId of release.yml
DanielLeinberger Jan 23, 2023
7dacb7e
Update .gitignore
AB-xdev Jan 23, 2023
2785a9f
Add IntelliJ config
AB-xdev Jan 23, 2023
97d1602
Use correct license
AB-xdev Jan 23, 2023
8feb451
Create SECURITY.md
AB-xdev Jan 23, 2023
95a7263
Create CHANGELOG.md
AB-xdev Jan 23, 2023
cda69c8
Create update-from-template.yml
AB-xdev Jan 23, 2023
35b8cd2
Create checkstyle.xml
AB-xdev Jan 23, 2023
3856b8f
Update pom.xml
AB-xdev Jan 23, 2023
011dbf2
Reworked REDME, introduced CONTRIBUTING.md
AB-xdev Jan 23, 2023
471861e
Fix render
AB-xdev Jan 23, 2023
59c4c03
Update README.md
AB-xdev Jan 23, 2023
303be9b
Merge pull request #12 from xdev-software/rework
AB-xdev Jan 23, 2023
15b09b6
Update checkBuild.yml
AB-xdev Jan 23, 2023
f28151e
Update release.yml
AB-xdev Jan 23, 2023
042c132
Update release.yml
AB-xdev Jan 23, 2023
122cd26
Update pom.xml
AB-xdev Jan 23, 2023
e80a62a
Update pom.xml
AB-xdev Jan 23, 2023
21c2770
Merge branch 'master' of https://github.com/xdev-software/xdev-swing-…
AB-xdev Jan 23, 2023
ae0cf63
Fix naming
AB-xdev Jan 23, 2023
b5f0fda
Update checkstyle-idea.xml
AB-xdev Jan 23, 2023
66efc56
Use ``com.xdev-software`` for now to not break existing repos
AB-xdev Jan 24, 2023
ca495f7
Update test-deploy.yml
AB-xdev Jan 24, 2023
ff7daea
Use existing version
AB-xdev Jan 24, 2023
a6db6b6
Merge remote-tracking branch 'upstream/master' into update-from-template
DanielLeinberger Jan 27, 2023
bc0c0d5
Updated md-files with correct url
DanielLeinberger Jan 27, 2023
5d4a849
Deleted license doc
DanielLeinberger Jan 27, 2023
158304f
Updated license doc
DanielLeinberger Jan 27, 2023
7f24e71
Cleanup pom
AB-xdev Jan 30, 2023
f7bc242
Remove unused dependency
AB-xdev Jan 30, 2023
46653cd
Fix release workflow
AB-xdev Jan 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/checkBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- '**.md'

jobs:
build_lts:
build:
runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -57,8 +57,9 @@ jobs:
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && mvn -B clean verify"
exit 1
fi

- uses: actions/upload-artifact@v3
with:
name: jars-lts-${{ matrix.java }}
name: jars-java-${{ matrix.java }}
path: target/*.jar
if-no-files-found: error
43 changes: 18 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ on:
push:
branches: [ master ]

permissions:
contents: write
pull-requests: write

jobs:
check_code: # Validates the code (see checkBuild.yml)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
Expand Down Expand Up @@ -57,11 +61,10 @@ jobs:

- name: Get version
id: version
# Ignores the suffix
run: |
read_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
parts=(${read_version//-/ })
echo "::set-output name=release::${parts[0]}"
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "release=$version" >> $GITHUB_OUTPUT
echo "releasenumber=${version//[!0-9]/}" >> $GITHUB_OUTPUT

- name: Commit and Push
run: |
Expand All @@ -73,25 +76,23 @@ jobs:

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: shogo82148/actions-create-release@v1
with:
tag_name: v${{ steps.version.outputs.release }}
release_name: v${{ steps.version.outputs.release }}
commitish: master
body: |
## 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)
## [Changelog](https://github.com/xdev-software/${{ github.event.repository.name }}/blob/develop/CHANGELOG.md#${{ steps.version.outputs.releasenumber }})
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.
## Installation
Add the following lines to your pom:
```XML
<dependency>
<groupId>com.xdev-software</groupId>
<artifactId>xapi-fx</artifactId>
<version>${{ steps.version.outputs.release }}-java<JavaVersion></version>
<artifactId>${{ github.event.repository.name }}</artifactId>
<version>${{ steps.version.outputs.release }}</version>
</dependency>
```
draft: false
prerelease: false

publish_central: # Publish the code to central
runs-on: ubuntu-latest
Expand All @@ -114,14 +115,8 @@ jobs:
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git pull

# Fixes OSSRH-66257
# See https://issues.sonatype.org/browse/OSSRH-66257?focusedCommentId=1036973&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1036973
- if: ${{ matrix.java == 17 }}
run: |
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

- name: Set up JDK and configure for ossrh
- name: Set up JDK OSSRH
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.distribution }}
Expand All @@ -133,16 +128,15 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

- name: Publish to Apache Maven Central
- name: Publish to OSSRH
run: mvn -B deploy -Possrh,java${{ matrix.java }}
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

publish-pages:
# Java 8-variant has no dependencies
name: Publish dependencies and licenses to github pages (Java 11)
name: Publish dependencies and licenses to github pages
runs-on: ubuntu-latest
needs: [prepare_release]
steps:
Expand All @@ -154,7 +148,7 @@ jobs:
git config --global user.name "GitHub Actions"
git pull

- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
Expand Down Expand Up @@ -232,7 +226,6 @@ jobs:
- name: pull-request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
destination_branch: "develop"
pr_title: "Sync back"
pr_body: "An automated PR to sync changes back"
13 changes: 3 additions & 10 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Test Deployment
name: Test Deployment CI

on:
workflow_dispatch:

jobs:
publish_central: # Publish the code to central
runs-on: ubuntu-latest

strategy:
matrix:
java: [11, 17]
Expand All @@ -21,13 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v3

# Fixes OSSRH-66257
# See https://issues.sonatype.org/browse/OSSRH-66257?focusedCommentId=1036973&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1036973
- if: ${{ matrix.java == 17 }}
run: |
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

- name: Set up JDK and configure for ossrh
- name: Set up JDK OSSRH
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: ${{ matrix.distribution }}
Expand All @@ -39,7 +32,7 @@ jobs:
gpg-passphrase: MAVEN_GPG_PASSPHRASE
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

- name: Publish to Apache Maven Central
- name: Publish to OSSRH
run: mvn -B deploy -Possrh,java${{ matrix.java }}
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
Expand Down
92 changes: 92 additions & 0 deletions .github/workflows/update-from-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Update from Template

# This workflow keeps the repo up to date with changes from the template repo (REMOTE_URL)
# It duplicates the REMOTE_BRANCH (into UPDATE_BRANCH) and tries to merge it into the
# this repos default branch (which is checked out here)
# Note that this requires a PAT (Personal Access Token) - at best from a servicing account
# Also note that you should have at least once merged the template repo into the current repo manually
# otherwise a "refusing to merge unrelated histories" error might occur.

on:
schedule:
- cron: '55 2 * * 1'
workflow_dispatch:

env:
UPDATE_BRANCH: update-from-template
REMOTE_URL: https://github.com/xdev-software/xdev-swing-framework-template.git
REMOTE_BRANCH: master

permissions:
contents: write
pull-requests: write

jobs:
update:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
# Required because otherwise there are always changes detected when executing diff/rev-list
fetch-depth: 0
# If no PAT is used the following error occurs on a push:
# refusing to allow a GitHub App to create or update workflow `.github/workflows/xxx.yml` without `workflows` permission
token: ${{ secrets.UPDATE_FROM_TEMPLATE_PAT }}

- name: Init Git
run: |
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"

- name: Main workflow
id: main
run: |
echo "Adding remote template-repo"
git remote add template ${{ env.REMOTE_URL }}

echo "Fetching remote template repo"
git fetch template

echo "Deleting local branch that will contain the updates - if present"
git branch -D ${{ env.UPDATE_BRANCH }} || true

echo "Checking if the remote template repo has new commits"
git rev-list ..template/${{ env.REMOTE_BRANCH }}

if [ $(git rev-list --count ..template/${{ env.REMOTE_BRANCH }}) -eq 0 ]; then
echo "There are no commits new commits on the template repo"

echo "Deleting origin branch that contains the updates - if present"
git push -f origin --delete ${{ env.UPDATE_BRANCH }} || true

echo "abort=1" >> $GITHUB_OUTPUT
exit 0
fi

echo "Found new commits on the template repo"

echo "Creating update branch"
git branch ${{ env.UPDATE_BRANCH }} template/${{ env.REMOTE_BRANCH }}
git branch --unset-upstream ${{ env.UPDATE_BRANCH }}

echo "Pushing update branch"
git push -f -u origin ${{ env.UPDATE_BRANCH }}

echo "Getting current branch"
current_branch=$(git branch --show-current)
echo "Current branch is $current_branch"
echo "current_branch=$current_branch" >> $GITHUB_OUTPUT

echo "abort=0" >> $GITHUB_OUTPUT

- name: pull-request
uses: repo-sync/pull-request@v2
if: steps.main.outputs.abort == 0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ env.UPDATE_BRANCH }}
destination_branch: ${{ steps.main.outputs.current_branch }}
pr_title: "Update from template"
pr_body: "An automated PR to sync changes from the template into this repo"

90 changes: 82 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,87 @@
# Maven
target/
bin/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

# IDEA
.idea/
*.iml

# Eclispe
.settings
.classpath
.project
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package/Binary Files don't belong into a git repo
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
*.dll
*.exe
*.bin

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*


# bin / compiled stuff
target/


# JRebel
**/resources/rebel.xml
**/resources/rebel-remote.xml

# eclispe stuff for root
/.settings/
/.classpath
/.project


# eclispe stuff for modules
/*/.metadata/
/*/.apt_generated_tests/
/*/.settings/
/*/.classpath
/*/.project
/*/RemoteSystemsTempFiles/

#custom
.flattened-pom.xml
.tern-project

# == IntelliJ ==
*.iml
*.ipr

# Some files are user/installation independent and are used for configuring the IDE
# See also https://stackoverflow.com/a/35279076

.idea/*
!.idea/saveactions_settings.xml
!.idea/checkstyle-idea.xml

!.idea/inspectionProfiles/
.idea/inspectionProfiles/*
!.idea/inspectionProfiles/Project_Default.xml

!.idea/codeStyles/
.idea/codeStyles/*
!.idea/codeStyles/codeStyleConfig.xml
!.idea/codeStyles/Project.xml
20 changes: 20 additions & 0 deletions .idea/checkstyle-idea.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading