Skip to content

Commit

Permalink
Merge branch 'master' into chore(uve)-fix-shouldShowUnlock-check-#28947
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinogiardino authored Jul 31, 2024
2 parents a94d8a5 + d272fcb commit 5d2ef6f
Show file tree
Hide file tree
Showing 3 changed files with 163 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/filters.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
full_build_test: &full_build_test
- '.sdkmanrc'
- 'core-web/.nvmrc'
- '.nvmrc'

backend: &backend
- '.github/workflows/maven-cicd-pipeline.yml'
- 'bom/**'
Expand All @@ -14,13 +19,16 @@ backend: &backend
- 'plugins-core/**'
- 'pom.xml'
- 'reports/**'
- *full_build_test

frontend: &frontend
- 'core-web/**'
- 'dotCMS/src/main/webapp/html/**/*.{css,js}'
- *full_build_test

cli: &cli
- 'tools/dotcms-cli/**'
- *full_build_test

jvm_unit_test:
- *backend
Expand Down
154 changes: 154 additions & 0 deletions .github/workflows/publish-starter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: Publish Starter
on:
workflow_dispatch:
inputs:
type:
description: 'Select a Starter type'
required: true
type: choice
options:
- 'Full Starter'
changelog:
description: 'Changes description'
required: true
type: string
dry-run:
description: 'Enable dry-run mode'
required: true
type: boolean

defaults:
run:
shell: bash

env:
STARTER_TYPE: ${{ github.event.inputs.type }}

jobs:
get-full-starter:
runs-on: macos-13
if: github.repository == 'dotcms/core'
environment: trunk
steps:
- name: Context
run: |
echo "Generating a Full Starter..."
echo "${{ toJSON(github.event.inputs) }}"
- name: 'Get zip file'
id: get-zip-file
env:
URL: ${{ vars.DOT_STARTER_URL }}
ACCESS_TOKEN: ${{ secrets.DOT_STARTER_ACCESS_TOKEN }}
run: |
echo "::group::Getting zip file"
mkdir -p starter && cd starter
RESP=$(curl -s -w "%{http_code}" --output $(date +'%Y%m%d').zip $URL \
-H "Content-Type: application/json" \
-H "Accept: application/octet-stream" \
-H "Authorization: Bearer $ACCESS_TOKEN")
if [[ "$RESP" != "200" ]]; then
echo "RESP: $RESP"
exit 1
fi
ls -ltrh
echo "::endgroup::"
- name: 'Upload artifacts'
id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: starter
path: |
${{ github.workspace }}/starter/*.zip
retention-days: 2
if-no-files-found: ignore

deploy-artifacts:
needs: [ get-full-starter ]
runs-on: ubuntu-20.04
environment: trunk
outputs:
filename: ${{ steps.deploy-artifacts.outputs.filename }}
url: ${{ steps.deploy-artifacts.outputs.url }}
steps:
- uses: jfrog/setup-jfrog-cli@v4
env:
JF_URL: ${{ vars.ARTIFACTORY_URL }}
JF_ACCESS_TOKEN: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}

- name: 'JFrog CLI context'
run: |
echo "::group::JFrog CLI context"
jf rt ping
echo "::endgroup::"
- name: 'Download artifacts'
uses: actions/download-artifact@v4
with:
github-token: ${{ github.token }}
name: starter
path: ${{ github.workspace }}/starter

- name: 'Listing artifacts'
run: ls -R

- name: 'Deploy artifacts'
id: deploy-artifacts
working-directory: ${{ github.workspace }}/starter
env:
ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }}
ARTIFACTORY_REPO: ${{ vars.ARTIFACTORY_REPO }}
GROUP_ID: com.dotcms
ARTIFACT_ID: starter
PACKAGING: zip
DRY_RUN_MODE: ${{ github.event.inputs.dry-run }}
run: |
echo "::group::Deploy Artifacts"
if [[ $DRY_RUN_MODE == true ]]; then
DRY_RUN='--dry-run'
fi
FILENAME=$(ls -ltr | awk 'END {print $NF}')
VERSION="${FILENAME%.*}"
SOURCE="./${FILENAME}"
TARGET="${ARTIFACTORY_REPO}/com/dotcms/${ARTIFACT_ID}/${VERSION}/${ARTIFACT_ID}-${FILENAME}"
PROPS="groupId=${GROUP_ID};artifactId=${ARTIFACT_ID};version=${VERSION};packaging=${PACKAGING}"
URL="${ARTIFACTORY_URL}/artifactory/${TARGET}"
echo "FILENAME=${FILENAME}"
echo "VERSION=${VERSION}"
echo "::notice::Uploading ${SOURCE} to ${TARGET} with props ${PROPS}"
jfrog rt u "${SOURCE}" ${TARGET} \
--target-props="${PROPS}" \
--flat=false \
$DRY_RUN
echo "filename=${FILENAME}" >> $GITHUB_OUTPUT
echo "url=${URL}" >> $GITHUB_OUTPUT
echo "::notice::Artifact URL ${URL}"
echo "::notice::Changelog: ${{ github.event.inputs.changelog }}"
echo "::endgroup::"
send-notification:
if: ${{ github.event.inputs.dry-run == 'false' }}
needs: [ deploy-artifacts ]
runs-on: ubuntu-20.04
environment: trunk
steps:
- name: Slack Notification
uses: slackapi/[email protected]
with:
channel-id: "log-starter"
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "> :large_green_circle: *Attention dotters:* a new Starter published!\n \n>This automated script is happy to announce that a new *_${{ env.STARTER_TYPE }}_* :package: `${{ needs.deploy-artifacts.outputs.filename }}` is now available on `ARTIFACTORY` :frog:!\n \n>:link:${{ needs.deploy-artifacts.outputs.url }}\n>*Changelog* \n>```${{ github.event.inputs.changelog }}```"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
java=11.0.22-ms
java=11.0.23-ms

0 comments on commit 5d2ef6f

Please sign in to comment.