Skip to content

Commit

Permalink
[build] Update release configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aalmiray committed Mar 2, 2022
1 parent f5d0997 commit 0fe3da0
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ name: Build

on:
push:
branches:
- '*'
branches: [ main ]
pull_request:

env:
JAVA_VERSION: '11'
JAVA_DISTRO: 'zulu'

jobs:
build:
Expand All @@ -15,18 +19,18 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}

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

- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'zulu'

- name: Build
run: ./mvnw --no-transfer-progress -B --file pom.xml verify
run: ./mvnw --no-transfer-progress -B --file pom.xml verify
42 changes: 19 additions & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ on:
workflow_dispatch:
inputs:
version:
description: "Release version"
description: 'Release version'
required: true

env:
JAVA_VERSION: '11'
JAVA_DISTRO: 'zulu'

jobs:
release:
name: Release
Expand All @@ -18,35 +22,35 @@ jobs:
with:
fetch-depth: 0

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

- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
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: Update version
- name: Cache Maven
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Version
run: |
VERSION=${{ github.event.inputs.version }}
echo "Updating POMs to version $VERSION"
./mvnw -B versions:set versions:commit -DnewVersion=$VERSION
echo $VERSION > VERSION
sed -i -e "s/^\:project-version\:\ .*/:project-version: ${VERSION}/g" README.adoc
git config --global user.email "kordamp-release-bot@kordamp.org"
git config --global user.name "kordamp-release-bot"
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 master
git push origin main
- name: Release
env:
Expand All @@ -59,12 +63,6 @@ jobs:
-Drepository.url=https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git \
-Dmaven.site.skip=true -Drelease=true deploy
- name: Set up Java 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'

- name: Release
uses: jreleaser/release-action@v1
env:
Expand All @@ -73,8 +71,6 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
JRELEASER_SDKMAN_CONSUMER_KEY: ${{ secrets.SDKMAN_CONSUMER_KEY }}
JRELEASER_SDKMAN_CONSUMER_TOKEN: ${{ secrets.SDKMAN_CONSUMER_TOKEN }}
JRELEASER_TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
JRELEASER_TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
JRELEASER_TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
Expand All @@ -84,7 +80,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v2
with:
name: artifact
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
14 changes: 8 additions & 6 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
project:
name: kordamp-maven-parent
description: Parent POM for all Maven based Kordamp projects.
longDescription: |
Parent POM for all Maven based Kordamp projects.
website: https://github.com/kordamp/kordamp-maven-parent/
website: https://github.com/kordamp/kordamp-maven-parent
authors:
- Andres Almiray
license: Apache-2.0
Expand All @@ -30,15 +28,15 @@ project:

release:
github:
branch: master
username: aalmiray
sign: true
overwrite: true
milestone:
name: '{{projectVersion}}'
changelog:
sort: DESC
formatted: ALWAYS
format: '- {{commitShortHash}} {{commitTitle}}'
contributors:
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
labelers:
- label: 'feature'
title: 'Resolves #'
Expand Down Expand Up @@ -87,6 +85,10 @@ release:
- search: '\[docs\] '
- search: '\[build\] '

signing:
active: always
armored: true

announce:
twitter:
active: release
Expand Down

0 comments on commit 0fe3da0

Please sign in to comment.