Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Update from template #84

Merged
merged 30 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 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
d4e2123
Merge remote-tracking branch 'upstream/master' into update-from-template
DanielLeinberger Jan 26, 2023
879a8ac
Updated md-files with correct url
DanielLeinberger Jan 26, 2023
1a8d6f8
Updated license doc
DanielLeinberger Jan 26, 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
5 changes: 3 additions & 2 deletions .github/workflows/checkBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
Expand Down Expand Up @@ -53,7 +53,8 @@ jobs:
exit 1
fi

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

permissions:
contents: write
pull-requests: write

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

- name: Set up JDK 8
uses: actions/setup-java@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'

cache: 'maven'

- name: Build with Maven
run: mvn -B clean verify

Expand Down Expand Up @@ -56,7 +61,9 @@ jobs:
- name: Get version
id: version
run: |
echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
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 @@ -68,25 +75,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-db-mysql-5?versionPrefix=${{ steps.version.outputs.release }})](https://mvnrepository.com/artifact/com.xdev-software/xapi-db-mysql-5)
## [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-db-mysql-5</artifactId>
<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 @@ -100,8 +105,8 @@ jobs:
git config --global user.name "GitHub Actions"
git pull

- name: Set up JDK 8 OSSRH
uses: actions/setup-java@v2
- name: Set up JDK OSSRH
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '8'
Expand All @@ -111,7 +116,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
env:
MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
Expand All @@ -131,8 +136,8 @@ jobs:
git config --global user.name "GitHub Actions"
git pull

- name: Set up JDK 8
uses: actions/setup-java@v2
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
Expand All @@ -141,7 +146,7 @@ jobs:
run: mvn -B project-info-reports:dependencies

- name: Upload licenses - Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: dependencies-licenses
path: target/site
Expand Down Expand Up @@ -195,7 +200,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"
6 changes: 3 additions & 3 deletions .github/workflows/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 8 Apache Maven Central
uses: actions/setup-java@v2
- name: Set up JDK OSSRH
uses: actions/setup-java@v3
with: # running setup-java again overwrites the settings.xml
distribution: 'temurin'
java-version: '8'
Expand All @@ -20,7 +20,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
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"

91 changes: 83 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +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/

# 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

# Eclispe
.settings
.classpath
.project
.checkstyle
!.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