Skip to content

Commit

Permalink
feat: module updates (#36)
Browse files Browse the repository at this point in the history
* Updated to use JAVA 17 and updated Abstarct connection provider

* Updated properties provider to override the namespace in secret path

* Updated namespace logic with the pattern matching using regex

* chore: build and formatting

* deps: ugprade bc dep

* chore: add ssl folder

---------

Co-authored-by: Anil Konakalla <[email protected]>
Co-authored-by: Anil Konakalla <[email protected]>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent c1cdfd7 commit 2054f50
Show file tree
Hide file tree
Showing 51 changed files with 2,434 additions and 2,206 deletions.
166 changes: 36 additions & 130 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,141 +1,47 @@
name: Build and Publish
name: Maven Build and Release for Mule-Plugin

on:
push:
branches:
- 'master'
- 'chore/**'
- 'feat/**'
- 'develop'
- 'fix/**'
pull_request:
branches:
- 'master'
- 'main'

jobs:
Build-and-Publish:
runs-on: ubuntu-latest
env:
MULE_EE_USERNAME: ${{ secrets.MULE_EE_USERNAME }}
MULE_EE_PASSWORD: ${{ secrets.MULE_EE_PASSWORD }}

outputs:
version: ${{ steps.set-version.outputs.version }}

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

- name: Set up JDK 1.8 for build and unit test
uses: actions/setup-java@v3
with:
distribution: adopt-hotspot
java-version: 8
cache: maven
server-id: mulesoft-ee-releases
server-username: MULE_EE_USERNAME
server-password: MULE_EE_PASSWORD

- name: Set Version
id: set-version
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 }}"

- name: Compile
run: ./mvnw compile

- name: Verify
run: ./mvnw --batch-mode verify

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: |
target/surefire-reports/*.xml
- name: Set up JDK 1.8 for maven central publish
uses: actions/setup-java@v3
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
with:
distribution: adopt-hotspot
java-version: 8
cache: maven
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE

- name: Publish to Maven Central
id: publish-to-maven-central
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
run: ./mvnw deploy -Drelease=true -DskipTests=true
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
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/master'}}
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/master'}}
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@v3
with:
fetch-depth: '0'
submodules: 'recursive'

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

- 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 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
with:
branch: "chore/v${{ steps.set-new-version.outputs.version }}"
commit-message: "chore: [create-pull-request] Auto increment to v${{ steps.set-new-version.outputs.version }}"
title: "chore: Auto increment to v${{ steps.set-new-version.outputs.version }}"
delete-branch: true
assignees: ${{ github.actor }}
reviewers: adesjardin, manikmagar, kkingavio
Build-Maven:
uses: avioconsulting/shared-workflows/.github/workflows/maven-build.yml@main
secrets: inherit
with:
include-mule-ee-repo: true
# java-distribution: adopt-hotspot
# java-version: 8
# include-test-results: true
# maven-args: -X

Release-Maven:
needs: Build-Maven
uses: avioconsulting/shared-workflows/.github/workflows/maven-release.yml@main
secrets: inherit
with:
app-version: ${{ needs.Build-Maven.outputs.app-version }}
publish-maven-central: true
# java-distribution: adopt-hotspot
# java-version: 8
# maven-args: -X
# main-branch: main

Post-Release-Maven:
needs: [Build-Maven, Release-Maven]
uses: avioconsulting/shared-workflows/.github/workflows/maven-post-release.yml@main
secrets: inherit
with:
app-version: ${{ needs.Build-Maven.outputs.app-version }}
# java-distribution: adopt-hotspot
# java-version: 8
# maven-args: -X
# main-branch: main
# pr-reviewers: adesjardin, manikmagar, kkingavio
2 changes: 1 addition & 1 deletion License.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ MuleSoft Certified Connectors are developed by MuleSoft’s partners and develop

By installing this connector, you consent to MuleSoft sharing your contact information with the developer of this connector so that you can receive more information about it directly from the developer.

See [LICENSE](LICENSE) for the license this connector is released under.
See [LICENSE](LICENSE) for the license this connector is released under.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ Attributes:

```xml
<vault-properties-provider:config name="config" >
<vault-properties-provider:iam-connection vaultUrl="http://localhost:8200"
engineVersion="v2"
<vault-properties-provider:iam-connection vaultUrl="http://localhost:8200"
engineVersion="v2"
awsAuthMount="aws"
vaultRole="test-role"
iamRequestUrl="https://sts.amazonaws.com/"
iamRequestBody="Action=GetCallerIdentity&Version=2011-06-15"
vaultRole="test-role"
iamRequestUrl="https://sts.amazonaws.com/"
iamRequestBody="Action=GetCallerIdentity&Version=2011-06-15"
iamRequestHeaders="" />
</vault-properties-provider:config>
```
Expand All @@ -138,7 +138,7 @@ Attributes:
* `engineVersion` - Version of the KV engine being used (v1 or v2)
* `awsAuthMount` - the Vault mount for AWS authentication
* `vaultRole` - the Vault role to login as
* `useInstanceMetadata` - true to login with instance metadata (PKCS7 is looked up on the host)
* `useInstanceMetadata` - true to login with instance metadata (PKCS7 is looked up on the host)

```xml
<vault-properties-provider:config name="config" >
Expand All @@ -158,10 +158,10 @@ Attributes:

```xml
<vault-properties-provider:config name="config" >
<vault-properties-provider:ec2-connection vaultUrl="http://localhost:8200"
engineVersion="v2"
awsAuthMount="aws"
vaultRole="test-role"
<vault-properties-provider:ec2-connection vaultUrl="http://localhost:8200"
engineVersion="v2"
awsAuthMount="aws"
vaultRole="test-role"
pkcs7="MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wHhcNMTEwNDI1MjA0NTIxWhcNMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ21uUSfwfEvySWtC2XADZ4nB+BLYgVIk60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9TrDHudUZg3qX4waLG5M43q7Wgc/MbQITxOUSQv7c7ugFFDzQGBzZswY6786m86gpEIbb3OhjZnzcvQAaRHhdlQWIMm2nrAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4nUhVVxYUntneD9+h8Mg9q6q+auNKyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0FkbFFBjvSfpJIlJ00zbhNYS5f6GuoEDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTbNYiytVbZPQUQ5Yaxu2jXnimvw3rrszlaEXAMPLE"/>
</vault-properties-provider:config>
```
Expand All @@ -182,7 +182,7 @@ Attributes:
```xml
<vault-properties-provider:config name="config" >
<vault-properties-provider:ec2-connection vaultUrl="http://localhost:8200" engineVersion="v2" awsAuthMount="aws" vaultRole="test-role">
<vault-properties-provider:identity-properties identity="eyAiZGV2cGF5UHJvZHVjdENvZGVzIiA6IG51bGwsICJtYXJrZXRwbGFjZVByb2R1Y3RDb2RlcyIgOiBbICIxYWJjMmRlZmdoaWprbG0zbm9wcXJzNHR1IiBdLCAiYXZhaWxhYmlsaXR5Wm9uZSIgOiAidXMtd2VzdC0yYiIsICJwcml2YXRlSXAiIDogIjEwLjE1OC4xMTIuODQiLCAidmVyc2lvbiIgOiAiMjAxNy0wOS0zMCIsICJpbnN0YW5jZUlkIiA6ICJp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URF5n0gwPNCuO6ICT0fNrm5IH7w9ydyaexamplejJw8XvWPxbuRkcN0TAA1p4RtCAqm4ms=x2oALjWSCBExample=" />
</vault-properties-provider:ec2-connection>
</vault-properties-provider:config>
Expand Down Expand Up @@ -227,7 +227,7 @@ In addition, update the `url` in the `distributionManagement` section of the pom
https://maven.anypoint.mulesoft.com/api/v1/organizations/${orgID}/maven
```

Add a `server` for the exchange repository in your Maven `settings.xml` file with the username and password to use for AnyPoint Exchange.
Add a `server` for the exchange repository in your Maven `settings.xml` file with the username and password to use for AnyPoint Exchange.

After it is published in the exchange, the dependency in a project would change to look like this:

Expand All @@ -238,4 +238,4 @@ After it is published in the exchange, the dependency in a project would change
<version>1.0.0-SNAPSHOT</version>
<classifier>mule-plugin</classifier>
</dependency>
```
```
Loading

0 comments on commit 2054f50

Please sign in to comment.