Skip to content

Commit

Permalink
Merge branch 'dotCMS:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
spbolton authored Mar 6, 2024
2 parents 9b280d3 + 42f3860 commit 664dbb9
Show file tree
Hide file tree
Showing 207 changed files with 2,470 additions and 1,178 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/cli-build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ on:
type: boolean
branch:
type: string
secrets:
dotcms-license:
description: 'DotCMS License Key'
required: true
artifactory-repo-username:
description: 'Artifactory Repository Username'
required: true
artifactory-repo-password:
description: 'Artifactory Repository Password'
required: true
github-token:
description: 'GitHub Token'
required: true

env:
JAVA_VERSION: 11
Expand Down Expand Up @@ -158,7 +171,7 @@ jobs:
- name: 'Prepare dotCMS license'
if: ${{ inputs.skipTests == false }}
env:
DOTCMS_LICENSE_KEY: ${{ secrets.DOTCMS_LICENSE }}
DOTCMS_LICENSE_KEY: ${{ secrets.dotcms-license }}
run: |
DOTCMS_LICENSE_PATH=${{ github.workspace }}/tools/dotcms-cli/license
mkdir -p ${DOTCMS_LICENSE_PATH}
Expand Down Expand Up @@ -251,12 +264,17 @@ jobs:
- name: 'Upload to Artifactory'
env:
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JRELEASER_ARTIFACTORY_USERNAME: ${{ secrets.EE_REPO_USERNAME }}
JRELEASER_ARTIFACTORY_PASSWORD: ${{ secrets.EE_REPO_PASSWORD }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.github-token }}
JRELEASER_ARTIFACTORY_USERNAME: ${{ secrets.artifactory-repo-username }}
JRELEASER_ARTIFACTORY_PASSWORD: ${{ secrets.artifactory-repo-password }}
working-directory: ${{ github.workspace }}
run: |
tools/dotcms-cli/mvnw -B -Prelease jreleaser:upload -DartifactsDir=artifacts -Djreleaser.git.root.search=true -pl :dotcms-cli-parent -Dmaven.plugin.validation=VERBOSE
if [[ "${{ inputs.buildNativeImage }}" == "true" ]]; then
DOTCMS_CLI_NATIVE_ACTIVE=ALWAYS
else
DOTCMS_CLI_NATIVE_ACTIVE=NEVER
fi
tools/dotcms-cli/mvnw -B -Prelease jreleaser:upload -DartifactsDir=artifacts -Djreleaser.distributions.dotcms.cli.native.active=$DOTCMS_CLI_NATIVE_ACTIVE -Djreleaser.git.root.search=true -pl :dotcms-cli-parent -Dmaven.plugin.validation=VERBOSE
- name: 'Cleanup'
run: |
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/cli-deploy-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'CLI Deploy Artifacts'
on:
push:
branches:
- 'master'
- 'main'
- 'trunk'
- 'release-*'
jobs:
build:
uses: ./.github/workflows/cli-build-artifacts.yml
with:
skipTests: true
buildNativeImage: false
uploadArtifacts: true
branch: ${{ github.ref_name }}
secrets:
dotcms-license: ${{ secrets.DOTCMS_LICENSE }}
artifactory-repo-username: ${{ secrets.EE_REPO_USERNAME }}
artifactory-repo-password: ${{ secrets.EE_REPO_PASSWORD }}
github-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 13 additions & 13 deletions .github/workflows/cli-release-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,55 +347,55 @@ jobs:
# Distinguishes between snapshots and releases
- name: 'Dynamic configuration of NPM package Version and Tag'
run: |
MVN_PACKAGE_VERSION=$(echo ${{ github.event.inputs.version }} | tr '[:lower:]' '[:upper:]')
MVN_PACKAGE_VERSION=$(echo ${{ github.event.inputs.version }} | tr '[:lower:]' '[:upper:]')
PACKAGE_FULL_NAME=${{ env.NPM_PACKAGE_SCOPE }}/${{ env.NPM_PACKAGE_NAME }}
# Check if the npm package exists
if ! npm view $PACKAGE_FULL_NAME &> /dev/null; then
echo "::error::The package $PACKAGE_FULL_NAME does not exist on npm."
exit 1
fi
# Check if the package is a snapshot
REGEX="([0-9]+\.[0-9]+\.[0-9]+)-SNAPSHOT"
if [[ $MVN_PACKAGE_VERSION =~ $REGEX ]]; then
echo "::debug::Snapshot version found."
NPM_PACKAGE_VERSION_TAG="rc"
MVN_BASE_VERSION="${BASH_REMATCH[1]}"
# Use regular expression to extract version components
if [[ $MVN_BASE_VERSION =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
MAJOR=$(echo "${BASH_REMATCH[1]}" | sed "s/\b0\+\([1-9]\)/\1/g")
MINOR=$(echo "${BASH_REMATCH[2]}" | sed "s/\b0\+\([1-9]\)/\1/g")
PATCH=$(echo "${BASH_REMATCH[3]}" | sed "s/\b0\+\([1-9]\)/\1/g")
VERSION_NPM_FORMAT="${MAJOR}.${MINOR}.${PATCH}"
echo "::debug::VERSION_NPM_FORMAT: ${VERSION_NPM_FORMAT}"
else
echo "::error::Invalid Maven version format: $MVN_BASE_VERSION"
exit 1
fi
LAST_RC_VERSION=$(npm view $PACKAGE_FULL_NAME versions --json | jq -r 'map(select(test("-rc\\d+$"))) | max')
if [[ $LAST_RC_VERSION == "$VERSION_NPM_FORMAT"* ]]; then
NEXT_RC_VERSION=$(echo "$LAST_RC_VERSION" | awk -F '-rc' '{print $1 "-rc" $2 + 1}')
RC_SUFFIX=$(echo "$NEXT_RC_VERSION" | sed -n 's/.*-rc\([0-9]*\)/-rc\1/p')
else
RC_SUFFIX="-rc1"
fi;
NPM_PACKAGE_VERSION=${MVN_BASE_VERSION}${RC_SUFFIX}
else
echo "::debug::Release version found."
NPM_PACKAGE_VERSION_TAG="latest"
NPM_PACKAGE_VERSION=${MVN_PACKAGE_VERSION}
fi;
fi;
echo "::debug::NPM_PACKAGE_VERSION: $NPM_PACKAGE_VERSION"
echo "::debug::NPM_PACKAGE_VERSION_TAG: $NPM_PACKAGE_VERSION_TAG"
echo "NPM_PACKAGE_VERSION=$NPM_PACKAGE_VERSION" >> $GITHUB_ENV
echo "NPM_PACKAGE_VERSION_TAG=$NPM_PACKAGE_VERSION_TAG" >> $GITHUB_ENV
Expand Down Expand Up @@ -449,4 +449,4 @@ jobs:

- name: 'Delete release auxiliary branch - ${{ needs.precheck.outputs.AUXILIARY_BRANCH }}'
run: |
git push origin --delete ${{ needs.precheck.outputs.AUXILIARY_BRANCH }}
git push origin --delete ${{ needs.precheck.outputs.AUXILIARY_BRANCH }}
2 changes: 1 addition & 1 deletion .github/workflows/maven-cicd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ jobs:
restore-keys: yarn-
- name: Build # expect node cache to exist from
shell: bash
run: eval ./mvnw -Dprod $JVM_TEST_MAVEN_OPTS $JVM_TEST_MAVEN_OPTS -pl :dotcms-core-web test
run: eval ./mvnw -Dprod $JVM_TEST_MAVEN_OPTS -pl :dotcms-core-web test
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/publish-npm-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: 'Publish NPM Package'
on:
workflow_call:
inputs:
ref:
description: 'Ref to checkout'
required: true
type: string
artifact-id:
description: 'Artifact id'
required: true
type: string
run-id:
description: 'Run id'
required: true
type: number
npm-package-version-tag:
description: 'NPM package version tag'
required: true
type: string
secrets:
gh-pat:
description: 'GitHub Personal Access Token'
required: true
npm-token:
description: 'NPM registry token'
required: false

env:
NODE_VERSION: 19

jobs:
publish-npm-package:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- uses: ./.github/actions/cleanup-runner

- name: 'Set up Node.js'
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: 'Download all build artifacts'
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/npm-package
name: ${{ inputs.artifact-id }}
run-id: ${{ inputs.run-id }}
github-token: ${{ secrets.gh-pat }} # token with actions:read permissions on target repo

- name: 'Validate NPM package'
run: |
echo "::group::NPM package contents"
if [ ! -f ${{ github.workspace }}/npm-package/package.json ]; then
echo "::error::NPM package not found. Exiting..."
exit 1
else
echo "::notice::NPM package found. Proceeding..."
cat ${{ github.workspace }}/npm-package/package.json
fi
- name: 'Publish to NPM registry'
if: success()
working-directory: ${{ github.workspace }}/npm-package
env:
NPM_AUTH_TOKEN: ${{ secrets.npm-token }}
NPM_PACKAGE_VERSION_TAG: ${{ inputs.npm-package-version-tag }}
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ~/.npmrc
npm publish --access public --tag ${NPM_PACKAGE_VERSION_TAG}
5 changes: 2 additions & 3 deletions core-web/apps/dotcms-ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

// App is our top level component
import { DotMessagePipe } from '@dotcms/ui';
import { DotPipesModule } from '@pipes/dot-pipes.module';
import { DotMessagePipe, DotSafeHtmlPipe } from '@dotcms/ui';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
Expand All @@ -34,7 +33,7 @@ import { SharedModule } from './shared/shared.module';
ReactiveFormsModule,
AppRoutingModule,
DotDirectivesModule,
DotPipesModule,
DotSafeHtmlPipe,
SharedModule.forRoot(),
MonacoEditorModule,
MarkdownModule.forRoot(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ const secrets = [
label: 'Name:',
required: true,
type: 'STRING',
value: 'test'
value: 'test',
hasEnvVar: false,
envShow: true,
hasEnvVarValue: false
},
{
dynamic: false,
Expand All @@ -37,7 +40,10 @@ const secrets = [
label: 'Password:',
required: true,
type: 'STRING',
value: '****'
value: '****',
hasEnvVar: false,
envShow: true,
hasEnvVarValue: false
},
{
dynamic: false,
Expand All @@ -47,7 +53,10 @@ const secrets = [
label: 'Enabled:',
required: false,
type: 'BOOL',
value: 'true'
value: 'true',
hasEnvVar: false,
envShow: true,
hasEnvVarValue: false
},
{
dynamic: false,
Expand All @@ -67,7 +76,10 @@ const secrets = [
],
required: true,
type: 'SELECT',
value: '1'
value: '1',
hasEnvVar: false,
envShow: true,
hasEnvVarValue: false
},
{
dynamic: false,
Expand All @@ -77,7 +89,10 @@ const secrets = [
label: 'Integration:',
required: false,
type: 'BUTTON',
value: 'urlLink'
value: 'urlLink',
hasEnvVar: false,
envShow: true,
hasEnvVarValue: false
}
];

Expand Down
Loading

0 comments on commit 664dbb9

Please sign in to comment.