Skip to content

Commit

Permalink
Migrated to new CI pipleline using jreleaser.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Jan 4, 2022
1 parent 258380d commit e93c544
Show file tree
Hide file tree
Showing 11 changed files with 745 additions and 133 deletions.
82 changes: 0 additions & 82 deletions .github/dependabot.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
if: startsWith(github.event.head_commit.message, '🏁 Releasing version') != true
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
Expand All @@ -33,4 +34,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -DskipTests=true
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 'Set up Java'
uses: actions/setup-java@v2
with:
java-version: 14
distribution: 'zulu'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: 'Cache Maven packages'
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Update version
id: version
run: |
VERSION=${{ github.event.inputs.version }}
echo "Updating POMs to version $VERSION"
./mvnw -B versions:set versions:commit -DnewVersion=$VERSION
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Action"
git commit -a -m "🏁 Releasing version $VERSION"
git push origin HEAD:master-11
- name: Release to Maven Central
env:
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
MAVEN_CENTRAL_TOKEN: ${{ secrets.SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
export GPG_TTY=$(tty)
./mvnw --no-transfer-progress -B --file pom.xml \
-Drepository.url=https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git \
-Dmaven.site.skip=true -Drelease=true deploy
- name: Release to GitHub
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./mvnw -B --file pom.xml -Prelease -pl :parent jreleaser:full-release

- name: JReleaser output
if: always()
uses: actions/upload-artifact@v2
with:
name: jreleaser-logs
path: |
target/jreleaser/trace.log
target/jreleaser/output.properties
Binary file added .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
43 changes: 43 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2021 Dirk Lemmermann Software & Consulting (dlsc.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

project:
name: GemsFX
description: A framework for easily creating a UI for application settings / preferences.
website: https://github.com/dlsc-software-consulting-gmbh/PreferencesFX
authors:
- Dirk Lemmermann
license: Apache-2.0
extraProperties:
inceptionYear: 2022

release:
github:
branch: master-11
overwrite: true
milestone:
name: '{{projectVersion}}'
changelog:
sort: DESC
formatted: ALWAYS
format: '- {{commitShortHash}} {{commitTitle}}'
contributors:
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
hide:
contributors:
- 'GitHub'
Loading

0 comments on commit e93c544

Please sign in to comment.