Skip to content

Commit

Permalink
Merge branch 'main' into feature/client-enforcement-policy-custom-con…
Browse files Browse the repository at this point in the history
…text
  • Loading branch information
manikmagar authored Nov 19, 2024
2 parents 928804d + 3931384 commit 3447379
Show file tree
Hide file tree
Showing 35 changed files with 915 additions and 1,071 deletions.
158 changes: 52 additions & 106 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,127 +3,73 @@ name: Build and Publish
on:
push:
branches:
- 'master'
- 'main'
- 'feat/**'
- 'chore/**'
- 'fix/**'
pull_request:
branches:
- 'master'
- 'main'

jobs:
Build-and-Publish:
Build-Setup:
runs-on: ubuntu-latest

env:
ANYPOINT_CLIENT_ID: ${{ secrets.ANYPOINT_CLIENT_ID }}
ANYPOINT_CLIENT_SECRET: ${{ secrets.ANYPOINT_CLIENT_SECRET }}
ANYPOINT_CONNECTED_APP_ID: ${{ secrets.ANYPOINT_CONNECTED_APP_ID }}
ANYPOINT_CONNECTED_APP_SECRET: ${{ secrets.ANYPOINT_CONNECTED_APP_SECRET }}
ANYPOINT_USERNAME: ${{ secrets.ANYPOINT_USERNAME }}
ANYPOINT_PASSWORD: ${{ secrets.ANYPOINT_PASSWORD }}
outputs:
version: ${{ steps.set-version.outputs.version }}
test-suite: ${{ steps.set-test-suite.outputs.GITHUB_TEST_SUITE }}
ANYPOINT_CLIENT_ID: ${{ env.ANYPOINT_CLIENT_ID }}
ANYPOINT_CLIENT_SECRET: ${{ env.ANYPOINT_CLIENT_SECRET }}
ANYPOINT_CONNECTED_APP_ID: ${{ env.ANYPOINT_CONNECTED_APP_ID }}
ANYPOINT_CONNECTED_APP_SECRET: ${{ env.ANYPOINT_CONNECTED_APP_SECRET }}
ANYPOINT_USERNAME: ${{ env.ANYPOINT_USERNAME }}
ANYPOINT_PASSWORD: ${{ env.ANYPOINT_PASSWORD }}

steps:
- uses: actions/checkout@v3
with:
- uses: actions/checkout@v4
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
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: 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: Set test suite
if: github.ref != 'refs/heads/master' && github.event_name != 'pull_request'
id: set-test-suite
if: github.ref != 'refs/heads/main' && github.event_name != 'pull_request'
run: echo "GITHUB_TEST_SUITE=UnitTestSuite" >> $GITHUB_ENV

- name: Compile
run: ./mvnw compile

- name: Verify
run: ./mvnw --batch-mode verify -Dtest=$GITHUB_TEST_SUITE -Danypoint.client.id=${{secrets.ANYPOINT_CLIENT_ID}} -Danypoint.client.secret=${{secrets.ANYPOINT_CLIENT_SECRET}} -Danypoint.connected-app.id=${{secrets.ANYPOINT_CONNECTED_APP_ID}} -Danypoint.connected-app.secret=${{secrets.ANYPOINT_CONNECTED_APP_SECRET}} -Danypoint.username=${{secrets.ANYPOINT_USERNAME}} -Danypoint.password=${{secrets.ANYPOINT_PASSWORD}}

- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: ./*/target/surefire-reports/*.xml

- name: Publish to Maven Central
id: publish-to-maven-central
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master'}}
run: ./mvnw clean deploy -DskipTests -Drelease=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/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@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: "feat/v${{ steps.set-new-version.outputs.version }}"
commit-message: "[create-pull-request] Auto increment to v${{ steps.set-new-version.outputs.version }}"
title: "Auto increment to v${{ steps.set-new-version.outputs.version }}"
delete-branch: true
assignees: ${{ github.actor }}
Build-Maven:
needs: Build-Setup
uses: avioconsulting/shared-workflows/.github/workflows/maven-build.yml@main
secrets: inherit
with:
include-mule-ee-repo: true
maven-args: -Dtest=${{ needs.Build-Setup.outputs.test-suite }} -Danypoint.client.id=${{ needs.Build-Setup.outputs.ANYPOINT_CLIENT_ID }} -Danypoint.client.secret=${{needs.Build-Setup.outputs.ANYPOINT_CLIENT_SECRET}} -Danypoint.connected-app.id=${{needs.Build-Setup.outputs.ANYPOINT_CONNECTED_APP_ID}} -Danypoint.connected-app.secret=${{needs.Build-Setup.outputs.ANYPOINT_CONNECTED_APP_SECRET}} -Danypoint.username=${{needs.Build-Setup.outputs.ANYPOINT_USERNAME}} -Danypoint.password=${{needs.Build-Setup.outputs.ANYPOINT_PASSWORD}}

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
4 changes: 4 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

## Require review from one of the members of this team

* @avioconsulting/avio-mulesoft-frameworks
2 changes: 1 addition & 1 deletion cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.avioconsulting.mule</groupId>
<artifactId>mule-deploy-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1-SNAPSHOT</version>
</parent>

<build>
Expand Down
16 changes: 14 additions & 2 deletions jreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ release:
contributors:
format: '- {{contributorName}}{{#contributorUsernameAsLink}} ({{.}}){{/contributorUsernameAsLink}}'
labelers:
- label: 'bot-commits'
contributor: 'regex:^.*(\[bot\])$'
- label: 'dependencies'
title: 'chore(deps):'
title: 'deps:'
order: 130
excludeLabels:
- 'bot-commits'
categories:
- title: '⚙️ Dependencies'
key: 'dependencies'
Expand All @@ -64,6 +68,14 @@ release:
- 'merge'
contributors:
- 'GitHub'
- '^.*(\[bot\])$'
replacers:
- search: 'feat: '
- search: 'fix: '
- search: 'chore: '
- search: 'deps: '
- search: 'test: '
- search: 'docs: '

checksum:
individual: true
Expand All @@ -89,4 +101,4 @@ signing:
#distributions:
# mule-health-check-api:
# artifacts:
# - path: target/mule-health-check-api-{{projectVersion}}-mule-plugin.jar
# - path: target/mule-health-check-api-{{projectVersion}}-mule-plugin.jar
5 changes: 5 additions & 0 deletions library/examples/muleDeploy_ch2.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ muleDeploy {
updateStrategy 'recreate'
forwardSslSession 'true'
publicUrl 'myapp.anypoint.com'
pathRewrite '/test'
releaseChannel 'EDGE'
javaVersion '17'
tracingEnabled 'true'
generateDefaultPublicUrl 'false'
}

environment 'DEV'
Expand Down
3 changes: 2 additions & 1 deletion library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>com.avioconsulting.mule</groupId>
<artifactId>mule-deploy-parent</artifactId>
<version>2.0.0-SNAPSHOT</version>
<version>2.0.1-SNAPSHOT</version>
</parent>

<properties>
Expand Down Expand Up @@ -88,6 +88,7 @@
<configuration>
<excludes>
<exclude>**/IntegrationTest.java</exclude>
<exclude>com.avioconsulting.mule.integrationtest.CloudHubV2IntegrationTest</exclude>
</excludes>
</configuration>
</execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ enum UpdateStrategy {
* Re-deployment is quicker than rolling and doesn’t require additional resources.
*/
recreate

String updateStrategy
}
Loading

0 comments on commit 3447379

Please sign in to comment.