-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into chore(uve)-fix-shouldShowUnlock-check-#28947
- Loading branch information
Showing
3 changed files
with
163 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
java=11.0.22-ms | ||
java=11.0.23-ms |