Skip to content

Commit

Permalink
build: Adding JReleaser to publishing releases. Updating github actio…
Browse files Browse the repository at this point in the history
…ns to use latest versions and new syntax.
  • Loading branch information
adesjardin committed Jun 16, 2023
1 parent ccf6315 commit 98fc480
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 16 deletions.
50 changes: 34 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ jobs:
version: ${{ steps.set-version.outputs.version }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'

- name: Set up JDK 1.8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: adopt-hotspot
java-version: 8
Expand All @@ -37,7 +38,7 @@ jobs:

- name: Set Version
id: set-version
run: echo ::set-output name=version::$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
run: echo version=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) >> $GITHUB_OUTPUT

- name: Print Version
run: echo "Version ${{ steps.set-version.outputs.version }}"
Expand All @@ -64,39 +65,56 @@ jobs:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

- name: JReleaser full-Release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
uses: jreleaser/release-action@v2
env:
JRELEASER_PROJECT_VERSION: ${{steps.set-version.outputs.version}}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_USERNAME: ${{ secrets.OSSRH_USERNAME }}
JRELEASER_NEXUS2_MAVEN_CENTRAL_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
JRELEASER_VERSION: 1.6.0
with:
version: ${{ env.JRELEASER_VERSION }}
arguments: full-release

- name: JReleaser release output
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main'}}
uses: actions/upload-artifact@v3
with:
name: jreleaser-release
path: |
out/jreleaser/trace.log
out/jreleaser/output.properties
Perform-Release:
runs-on: ubuntu-latest
needs: Build-and-Publish
if: ${{ !contains(needs.Build-and-Publish.outputs.version, 'SNAPSHOT') && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: '0'
submodules: 'recursive'

- name: Set up JDK 1.8
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: adopt-hotspot
java-version: 8
cache: maven

- name: Tag Release
env:
GIT_USER: ${{ secrets.GIT_USER }}
GIT_PASSWORD: ${{ secrets.GIT_TOKEN }}
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
git remote set-url origin "https://${{github.actor}}:${{ github.token }}@github.com/${{ github.repository }}.git"
git tag -a "v${{ needs.Build-and-Publish.outputs.version }}" "${{ github.sha }}" -m "Version ${{ needs.Build-and-Publish.outputs.version }}"
git push origin "v${{ needs.Build-and-Publish.outputs.version }}"
- name: Increment Version
run: |
./mvnw clean build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT -DprocessAllModules versions:commit
- name: Set New Version Variable
id: set-new-version
run: echo ::set-output name=version::$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)
run: echo version=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) >> $GITHUB_OUTPUT

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
Expand Down
92 changes: 92 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
project:
name: mule-deploy
description: Mule Deploy is a library/CLI/Maven plugin that provides full lifecycle deployment of MuleSoft applications and API's
longDescription: |
Mule Deploy is a Java/Groovy based library to handle the deployment and lifecycle management of MuleSoft applications
and API's. It provides a CLI and Maven plugin so that it can be called from existing build tools and CI/CD platforms.
Mule Deploy can deploy applications to CloudHub, CloudHub 2.0, Runtime Fabric and Standalone Mule runtimes. It can
also synchronize API specifications to design center, publish specs from design center to Exchange, and deploy API's
from exchange to API Manager and promote them between environments. It can also handle policy attachment to those API's.
links:
homepage: https://github.com/avioconsulting/mule-deploy-library
documentation: https://github.com/avioconsulting/mule-deploy-library
license: https://github.com/avioconsulting/mule-deploy-library/blob/main/LICENSE
contribute: https://github.com/avioconsulting/mule-deploy-library/blob/main/README.adoc
authors:
- Adam DesJardin
- Brady Wied
- Tim Gonzales
- Talysson Castro
- Manik Magar
license: BSD-2-Clause
inceptionYear: 2020
tags:
- mule
java:
groupId: com.avioconsulting.mule
version: 8
versionPattern: SEMVER
snapshot:
pattern: .*-SNAPSHOT
label: early-access
fullChangelog: true

release:
github:
owner: 'avioconsulting'
overwrite: true
draft: false
sign: true
releaseName: '{{tagName}}'
skipTag: false
milestone:
close: false
changelog:
skipMergeCommits: true
formatted: ALWAYS
preset: conventional-commits
format: '- {{commitShortHash}} {{commitTitle}}'
contributors:
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
labelers:
- label: 'dependencies'
title: 'chore(deps):'
order: 130
categories:
- title: '⚙️ Dependencies'
key: 'dependencies'
order: 80
labels:
- 'dependencies'
hide:
categories:
- 'merge'
contributors:
- 'GitHub'

checksum:
individual: true

signing:
active: ALWAYS
armored: true
mode: MEMORY

#deploy:
# maven:
# nexus2:
# maven-central:
# active: ALWAYS
# url: https://oss.sonatype.org/service/local
# snapshotUrl: https://oss.sonatype.org/content/repositories/snapshots/
# applyMavenCentralRules: true
# closeRepository: true
# releaseRepository: true
# stagingRepositories:
# - target/staging-deploy

#distributions:
# mule-health-check-api:
# artifacts:
# - path: target/mule-health-check-api-{{projectVersion}}-mule-plugin.jar

0 comments on commit 98fc480

Please sign in to comment.